Displaying a Location on a Map Using the BingMapsTask

The Bing Maps task allows you to launch the built-in Maps application centered at the location specified by the BingMapsTask.Center property, which is of type GeoCoordinate. If not specified the map is centered at the user’s current location. If provided, the Center property is ignored and the BingMapsTask.SearchTerm property is used to search for matching locations. The best match is then tagged on the map.

To use the BingMapsTask to search for a location, define it as a field in your class and set its SearchTerm property, as demonstrated:

BingMapsTask bingMapsTask = new BingMapsTask();...bingMapsTask.SearchTerm = "prague";bingMapsTask.Show();

The following example ...

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.