The BingMapsTask
is similar to the BingMapsDirectionsTask
Launcher, except for the difference that BingMapsTask
launches the Bing Maps app from the Windows Phone, and can allow it to be pre-populated with a search keyword or mark locations on the map.
We can modify the previous example to use BingMapsTask
and populate a search result for Pizza
when the hyperlink button Search for Pizza is clicked or touched:
HelloMaps-Pushpin
project and rename it HelloMaps-Search
. Microsoft.Phone.Tasks
namespace. BingMapsTask
in your main class as:BingMapsTask myBingMapsTask;
MainPage()
constructor, we instantiate myBingMapsTask
, center it to a position near Redmond, and finally define the search term as Pizza
using the following lines of code:// Show Bing Maps and search for Pizza myBingMapsTask = new BingMapsTask(); myBingMapsTask.Center = new GeoCoordinate (47.6601, -122.13333); myBingMapsTask.SearchTerm = "Pizza"; // End of Bing Maps
Click()
method of hyperlinkButton1
as:private void hyperlinkButton1_Click(object sender, RoutedEventArgs e) { myBingMapsTask.Show(); }
You can find this example project in the code files for the book under Chapter 3
, titled HelloMaps-Search.
3.147.79.241