When the sample loads, the default map is displayed. The icon buttons and menu items on the app bar provide the following options:
-
Toggle your location on and off. This command finds your current location and then centers the map on the location. It displays a small filled blue circle to mark the location. If the location is already displayed, then choosing this option again removes the circle marking the location.
-
Toggle landmarks on and off. This command enables the display of landmarks by setting the LandmarksEnabledProperty property to true. If the zoom level of the map is less than the zoom level required for the display of landmarks, this command increases the zoom level. If landmarks are already displayed, then choosing this option again sets the LandmarksEnabled property to false.
-
Zoom in. Increases the zoom level by 1.
-
Zoom out. Decreases the zoom level by 1.
This sample uses APIs from the following namespaces.
-
From the Maps and Maps.Controls namespaces to display and configure the Map control.
-
From the Devices.Geolocation and Device.Location namespaces to find and set the current location.
-
From the Shapes and Media namespaces to mark the location with a colored circle.
Build the sample
-
Start Visual Studio and select File > Open > Project/Solution.
-
Browse to the directory in which you unzipped the sample. Double-click the solution (.sln) file.
The solution opens in Visual Studio.
-
Use Build > Rebuild Solution to build the sample.
Run the sample
-
To run the app with debugging, press F5 or use Debug > Start Debugging.
- or -
-
To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.