Mapsui - Retrieve geolocation from a given address or Usage of Nominatum

Mar 5, 2014 at 6:14 AM

I would like to know if Mapsui supports the feature of retrieving geolocation from a given address.

Let us know if 'Nominatum tool' can be used along with Mapsui to do the same.

If yes, please give me more inputs and as to how one can integrate with Silverlight and HTML5.

Otherwise, could you please suggest better options to explore?

Thanks in advance!

Mar 5, 2014 at 6:58 AM
Edited Mar 5, 2014 at 9:34 AM
There is no specific support for geocoding. You could call a geocoder service in your own code. Integration between the geocoder and Mapsui would be limited. From the geocoder you get a location. You need to reproject the output of your geocoder to the map coordinate sytem. The most common case is that your geocoder returns wgs84 and your map is in SphericalMercator. In that case you could use the included Mapsui.Projection.SphericalMercator.FromLonLat(). Then you could center your map on that location with "Map.Viewport.Center = location". You could also add a MemoryLayer with a pointsymbol for the found location.

From Silverlight you could not use Nominatum locally. You need to access it through a service.

Given this example:
You should call the service and parse the result xml in your own code. From this result get the lon and lat to center on your location with this:
MapControl.Map.Viewport.Center = SphericalMercator.FromLonLat(lon, lat);