Getting Started with the Map Control

To use the Map control, begin by ensuring that the ID_Cap_Map capability is selected in the project’s WMAppManifest.xml file. Without the capability, an exception is raised at runtime.

Adding a Map control to a page requires a namespace definition at the top of the page, as shown:

xmlns:m="clr-namespace:Microsoft.Phone.Maps.Controls;                                      assembly=Microsoft.Phone.Maps"

An m:Map element can then be placed somewhere on your host page, like so:

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">    <m:Map Loaded="HandleMapLoaded" /></Grid>

The Map control requires an API key to function in production. The Map ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.