This is a migrated thread and some comments may be shown as answers.

Strange behavior of UriImageProvider

1 Answer 44 Views
Map
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 18 Nov 2017, 07:59 PM

I'm using the UriImageProvider to add multiple tiles I've generated using GDAL to the map control. Each image covers exactly one degree of latitude and longitude.

When I loop through my image files to add them, the resulting tiles don't seem to be added in the correct place. Attached is a screen shot and here is my code to add the images.

var files = Directory.GetFiles( $"{Directory.GetCurrentDirectory()}\\Assets\\Terrain\\", "*_comp.tif" );
 
            foreach( var f in files )
            {
                Location bottomLeftCorner = ParseHgtFileCoordinates( f );
                Location topLeft = new Location( bottomLeftCorner.Latitude + 1, bottomLeftCorner.Longitude );
                Location bottomRight = new Location( bottomLeftCorner.Latitude, bottomLeftCorner.Longitude + 1 );
                LocationRect bounds = new LocationRect( topLeft, bottomRight );
 
                UriImageProvider p = new UriImageProvider();
                p.GeoBounds = bounds;
                p.Uri = new Uri( f );
                 
                map.Providers.Add( p );
            }

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 22 Nov 2017, 01:21 PM
Hello David,

To be honest we haven't used UriImageProviders in such way to combine images into one bigger image. Isn't it actually easier to combine the images first and then use one single ImageProvider ? To double check your calculation methods, we encourage you to use multiple Map instances (with one image in every map) placed one next to other and check if the positions of all small images are correct. If none if these helps, can you send us the edge calculating functions and the Images, so that we can test this locally. Of course, runnable sample would be the best possible option for us. Thank you in advance for your cooperation.

Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Map
Asked by
David
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or