Get pointlatlng from text (place)

Topics: General
Oct 21, 2011 at 10:04 AM


I have a textbox with a place name in it: e.g. Amsterdam, Netherlands. When I click a button I want to get the poinlatlng of the city. Which parameter do I need to look into?

button1_click(....) handles
   messagebox (........)
end sub
Thanks in advance.

Oct 21, 2011 at 11:08 AM


Oct 21, 2011 at 1:26 PM

Thanks works like a charm. There is a small thing left. I read that you can use myMap.MapProvider.GetPlacemark, to "convert" it to "name", but it isn't there.

Oct 21, 2011 at 2:13 PM
Edited Oct 21, 2011 at 2:14 PM

because not every provider has implemented geocoding/etc first you need to cast it:

var g = map.MapProvider as GeocodingProvider;
if( g != null)

or just use exact provider, like openstreet or google:

GMapProviders.CloudMadeMap.GetRouteBetweenPoints ...