Bing map silverlight Localization
-
Sunday, January 16, 2011 3:02 AM
Hello,
I am wondering if it's possible to change the resources (NavigationResources) of the Navigation control according to a culture (french in my case) ?
I wish display the labels of the Navigation control in french.
Is there a way to that or do I need to redefine all the Navigation control ?
Thank you.
- Edited by alaksjukilo Monday, January 17, 2011 6:55 PM
- Moved by Richard_BrundrittMicrosoft Employee, Owner Friday, March 09, 2012 1:56 PM (From:Bing Maps: Map Control and Web services Development)
All Replies
-
Monday, January 17, 2011 12:13 PMModerator
Hi,
I'm not aware of a simple way to redefine only the strings used for the navigation control labels. Setting Culture="fr-FR" on the map object localises the labels shown for placenames on map tiles, but not the control labels of the dashboard. Setting Culture="fr-FR" on the Map.MapForeground (which is the object you normally use to modify the dashboard) does, well, nothing.
I don't know if I'm missing something, because the developer datasheet at http://download.microsoft.com/download/3/7/E/37ECE5D4-5A23-4253-9100-FC0ADDD6B371/Bing_Maps%20Developer_Data_Sheet.pdf specifically states that the navigation control is customisable into a number of supported languages....
As a workaround, the following example demonstrates how you can redefine the navigation control completely, replacing the "Road" and "Aerial" labels with"My Satellite" and "My Road" - although obviously you can use any label you want:
http://www.microsoft.com/maps/isdk/silverlight/default.htm#MapControlInteractiveSdk.Tutorials.ExtendNavControl
Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Wednesday, April 06, 2011 10:14 AM
-
Monday, January 17, 2011 7:16 PM
Thank you for your reply tanoshimi!
I tried with the specified workaround, but the ZoomIn, ZoomOut and the Compass are still in english... No way to localize these fields.
So I tried to create my own MapControlNavigationBar (Represents a customized or localized NavigationBar control that can be added to a map.).
Once I created this control(with my new resources), I realized that the myMap.MapForeground.NavigationBar is in readonly :S ... No way to assign it directly.. Really don't understand why it's a private set on this property!!!
The workaround I found is to set myMap.NavigationVisibility to Collapsed. And to do (xaml code) :
<bing:map NavigationVisility=Collapsed name="myMap" ....>
<local:MyNavigationControlBar name="navBar" />
</bing:map>
In Code behind :
this.navBar.TargetMap = this.myMap.
Suprinsgly it's works!!! I thought...
Unfortunately, I still see a tooltip("Pan in any directions") on the pan control.. This tooltip is defined in the MapControlCompass, i would create my own compass, but same thing, I don't know how to assign it to my MyNavigationControlBar, all properties are readonly...
And now I am here, no more ideas...
-
Tuesday, January 18, 2011 12:54 PMOwner
You can hide the built in navigation controls and create your own custom ones. This is how many people get around this issue you are experiencing.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com | http://inknowledge.co.uk- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Wednesday, April 06, 2011 10:14 AM

