Adding a custom marker to a map
A default map icon, presented in the previous recipe, could not be suitable in all applications. For example, it could not match the design that is applied in the project. Thus, it should be replaced with another one, which is consistent with the overall visual identity. In this recipe, you will learn how to place a custom marker on the map.
As an example, you will prepare an application that obtains the current location of the user using the GPS receiver. Then it will center the map on this location and place a custom image representing the user.
Getting ready
To step through this recipe, you need only the automatically generated project.
How to do it...
To prepare an example that adds a custom marker on the map in the current location of the user, perform the following steps:
- Enable the
Location
capability by double-clicking on thePackage.appxmanifest
file in the Solution Explorer window, choosing the Capabilities tab, and selecting the Location checkbox...