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

Large Image Display

3 Answers 280 Views
Map
This is a migrated thread and some comments may be shown as answers.
Dominic
Top achievements
Rank 1
Dominic asked on 06 Jun 2017, 08:24 AM

Hi,
We want to use the RadMap as an instrument to display large images from hard disk by using a custom tiled map provider. Data and tile access works (using GetCachedTile and a Stream), but we have problems to adapt the coordinates.
We'd like to have a clean way (without using code behind), adhering to the MVVM pattern, to somehow extract map coordinates at Mouse Move events.

How can we bind or access locations?
Do you have some ideas how to translate geo coordinates to 2D coordinates (best would be in pixels X/Y from map boarder / tile 0/0)?
Could we avoid geo coordinates in general?

The most important feature for us is a smooth display of tiled image data - is there a different rad control which would facilitate this?

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Jun 2017, 11:02 AM
Hello Dominic,

To convert between mouse coordinates and map locations you can use the following methods:
  • The GetPoint() method of the Location class. It returns the screen position of the given location relative to the size of the control
  • The static GetCoordinates() method of the Location class. It returns a Location object based on screen coordinates.
Additionally, you can check the UriImageProvider article and SDK example.

But in general when you load a tile image from the Stream, you no longer have access to the tile's information. Or at least you cannot get this easily. Can you tell me why you need to translate the coordinates and why you want to get them in the mouse events?

Regards,
Martin Ivanov
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.
0
Dominic
Top achievements
Rank 1
answered on 09 Jun 2017, 10:36 AM

Hello Martin,

We deliberately avoided using the UriImageProvider to profit from the tile system of the TiledMapSource. Our Images can be several GB of data which are present in 16 bit. The tiles are dynamically converted to 8 bit data on the fly while loading.

Basically, we want to create our own map from microscope images, which then has their own coordinate system in the range of mm instead of km.

Is there the possibility to involve a strictly 2d projection instead of the MercatorProjection for the SpatialReference in our custom MapProvider?

In the end, we'd like to get the coordinates when doing a double click on an area of interest to perform further actions. Getting the coordinates during mouse move is a bonus, but not essential.

 

Regards,

Dominic Tietz

0
Martin Ivanov
Telerik team
answered on 14 Jun 2017, 08:26 AM
Hello Dominic,

Thanks for the additional information. 

The map's tile providers can work only with spatial coordinates. To achieve your requirement you will need to convert the 2D coordinates of the images to valid Mercator locations on the map.

Alternatively you can check the RadDiagram control and see if it would work for your scenario. Using this control you can plot shapes on a 2D surface. Each image from your set could be a different shape on the surface. However, in this case you won't be able to use the Mercator coordinates.

Regards,
Martin Ivanov
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
Dominic
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Dominic
Top achievements
Rank 1
Share this question
or