O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

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

Showing a Location with the Built-In Maps App

Often it is not necessary to go to the trouble of building a dedicated map view into your app. The built-in Maps app can be launched directly from your own app using the MapsTask launcher. Observe the following example:

MapsTask mapsTask = new MapsTask    {        Center = new GeoCoordinate(47.6204, -122.3493),        ZoomLevel = 8,        SearchTerm = "Caffe"    };mapsTask.Show();

The MapsTask class allows you to position the map view using its Center and ZoomLevel properties. You can also specify a search term that causes the map to display all matching search results on the map.

The sample’s MapViewModel class demonstrates the MapsTask using a command named ViewInMapsAppCommand ...

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