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 demonstrates how to specify a geographic location:

bingMapsTask.Center = new GeoCoordinate(50.08021, 14.416983);
bingMapsTask.Show();

A sample for the BingMapsTask can be found in the LaunchersAndChoosers/BingMaps directory of the WPUnleashed.Examples project. The sample is almost identical to the previous BingMapsDirectionsTask sample.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.218.105