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.
To prepare an example that adds an ellipse on the map in the location pressed by a user, perform the following steps:
Add the
MapControl
control (presenting the map) to the page and handle the event of tapping the map (MapTapped
). To do so, modify the content of theMainPage.xaml
file, as shown...