سؤال

How to get coordinates from location picked by user?
For example, the user points some place on map, and the coordinates are showed in textBox.
I've found some reverse geolocation, but I don't need an address, only the coordinates.

هل كانت مفيدة؟

المحلول

Do something like this:

MyMap.Tap += (s, e) =>
{
    var loc = MyMap.ConvertViewportPointToGeoCoordinate(e.GetPosition(MyMap));

    //Do something with the selected location
};

نصائح أخرى

Google maps have a api for developers to embed a google maps inside a website, there is a function to find the coordinates of the pin by user, the api use JavaScript to control. I don't know if it can run in a program but it is design for a website.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top