Monthly Archives: July 2011

“Integrate" Bing Maps directions in your WP7 app

in the upcoming “Mango” update for Windows Phone 7, Microsoft has already released the Windows Phone Developer Tools Beta 2 for this new version which has got version number 7.1.

One of the new cool features which is included in this beta release is the support to use the “Directions” feature in Bing Maps from your app. This feature makes it very easy to make a location aware app and makes it interactive to the user to help him find a specific spot. (Think about an app that helps users find only your restaurants, ATM’s, your company or anything else that has a coordinate)

Please note that I’m trying to keep away from the “integrate” part, cause actually it’s not integrating but more like navigating away from your app to Bing Maps with the location you specified in your app.

Okay, bring on this new feature and show us how to do this.

First, let’s start with the introduction of this feature/class/task or how you want to call it. We are talking about the BingMapsDirectionsTask which is a very simple class that lives in the Microsoft.Phone.Tasks namespace. You can use this task to create a route on Bing Maps from your app. In short terms this class has three important objects (2 properties / 1 method). It has a Start and an End property, and a method Show() which is it.

Both properties are of type LabeledMapLocation, which have a constructor that expected a string for the name and GeoCoordinate for the location.

In general below code will be enough to create a route on the Bing Maps app:

1 BingMapsDirectionsTask directionTask = new BingMapsDirectionsTask(); 2 directionTask.Start = new LabeledMapLocation("Start", new GeoCoordinate(52.512794, 6.091539)); 3 directionTask.End = new LabeledMapLocation("End", new GeoCoordinate(52.512794, 6.091539)); 4 5 directionTask.Show();

Just three lines of code. Can it be easier?

Yes it can!

If you don’t assign a value to the start property than it will automatically take your location and calculate a route to your End location.

I have created a sample solution where you can use the locations from the emulator to specify a start location and when you click on the map it will take your position (which is set by the emulator) and calculate a route to the location you have clicked.

BingMapsLocationChooser

Choose a location by using the Additional tools.

BingMapsDirections

And there it is our own created direction in the Bing Maps app.

To be honest I’m a bit in doubt about what I think about this feature. On one side it’s a very handy, easily to implement feature that will give you navigation/routing to your location in minutes.

Another thought I still have is I’m adding a map control to my app, a user clicks around and if it needs to calculate a route it exits my app, and starts Bing Maps. No real integration.

Anyone having some thoughts about it?

Download:

Updated language support in Windows Phone 7 “Mango”

In the first release of Windows Phone 7 there was support for a few languages (English (US and UK), French, German, Italian, and Spanish.) With the Mango update Microsoft is adding 17 more languages: Brazilian Portuguese, Chinese (simplified and traditional), Czech, Danish, Dutch, Finnish, Greek, Hungarian, Japanese, Korean, Norwegian (Bokmål), Polish, Portuguese, Russian, and Swedish.

 

As I blogged earlier about the Windows Phone 7 directions button missing and how to get your directions button back. This feature is with Mango updated with support in 19 countries. As you can see in below list of features and in which language it is supported, the “Local search results” or “Scout”  as it is called either, will only be available (for now) in the Windows Phone 7 “Launch” countries. Note that if you set your browser & search language to a non supported language than the “Scout” button will disappear from the Bing Maps menu bar.

 

ScoutButton <= That’s the one you’re missing if you are setting the Browser & Search language to a non Local search results country.

 

  • Bing search (accessed from the phone’s hardware Search button) is available in 33 countries: Argentina, Australia, Austria, Belgium, Brazil, Canada, Denmark, Finland, France, Germany, Hong Kong, India, Indonesia, Ireland, Italy, Japan, Korea, Malaysia, Mexico, Netherlands, New Zealand, Norway, Philippines, Portugal, Russia, Singapore, South Africa, Spain, Sweden, Switzerland, Taiwan, United Kingdom, and the United States. (Elsewhere, handset and mobile operators can configure the hardware search button to a locally-relevant search site).
  • Local search results show up in 6 countries: Australia, Canada, France, Germany, United Kingdom, and the United States.
  • Maps is supported in 19 countries: Australia, Austria, Belgium, Brazil, Canada, Denmark, Finland, France, Germany, Italy, Netherlands, New Zealand, Portugal, Singapore, Spain, Sweden, Switzerland, United Kingdom, and the United States.
  • Voice-to-text and Voice-to-dial is available in 6 countries: France, Germany, Italy, Spain, United Kingdom, and the Unites States.
  • Voice search is supported in 4 countries: France, Germany, United Kingdom, and the United States.

 

One nice thing to mention about the language and region settings is that there are a lot of settings which in Mango don’t require your device to be restarted, but can be applied instant. That makes it easier to play around with these settings and find your own favorite.

 

Language support source:

http://www.everythingwm.com/microsoft-details-language-support-in-mango-update-for-windows-phone/2011/07/11/#more-4824