O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting the coordinates of a clicked point on a map

The MapControl control, available for UWP applications, supports various ways of user interaction. For example, you can handle an event that is fired when the user presses the map. Of course, you can get the latitude and longitude of this location. In this recipe, you will learn how to perform this task.

As an example, you will create an application that presents the map. After clicking on it, an ellipse should be added in the clicked point. Of course, such ellipses should be shown correctly regardless of the location and the zoom level of the map.

Getting ready

To step through this recipe, you need only the automatically generated project.

How to do it...

To prepare an example that adds an ellipse ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required