Win 8.1 Bing map control displays chinese characters on application initialisation

Al 1 Reputation point
2021-04-08T08:33:55.103+00:00

Hi
A win8.1 app, which used the Win 8.1 Bing map control, was migrated to a UWP App. But the 8.1 BingMap control is still being used (I assume due to existing customer's licences etc).

Lately we've noticed that if the device language is not English, then first time a user navigates to the map screen, it displays what appears to be Chinese characters. The Chinese language pack has not been installed on the device.

Navigating away from this map-screen and coming back seems to display English, even when the device language is set to Spanish. Spanish language pack is present on the device.

The UWP App's PrimaryLanguageOverride is set to the current language (GlobalizationPreferences.Languages[0]) at app initialisation time.
Also this doesn’t happen when debugging the application.

occurs on
Windows 10 Enterprise - Version: 1809 - Build: 17763.973,
Windows 10 - version: 1909 - Build : 18363.1440
and others as it's been reported by users

Does not occur on
Windows 10 Build : 17763.1577

Any help or insight on this issue is appreciated

Al

Developer technologies | Universal Windows Platform (UWP)
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Al 1 Reputation point
    2021-04-09T10:03:56.307+00:00

    Hi

    When the device language is english, this Chinese character do not display.

    As for code, there is nothing special on the page/map level.
    Bing map control just sits in a grid. When the Map page is navigated to it displays XAML circles at locations on the map.

    Bing Map control details:
    Name: Bing Maps for C#, C++, or Visual Basic
    FileType: SDK
    Identity: Bing.Maps.Xaml, Version=1.313.0825.0
    Path: C:\Users\myself\AppData\Local\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Bing.Maps.Xaml\1.313.0825.0\
    Resolved: True
    Version: 1.313.825.0

    //-----------------------

    XAML MapPage.xaml

    <Grid >

    <local:MapView x:Name="mapViewControl" Zoom="15"   
                       Credentials="MyCredentialsUplrgw3Gn4fhk8m_P_etc"   
                       MapServiceToken="q_SOME_Tokenc4cJuixLOpEJ_lw" />  
    

    </Grid>

    ...and in the Code behind is MapPage.xaml.cs

    public sealed partial class MapPopup : Page
    {
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
    // get data.

    	foreach(dataItem in dataItems)  
    	{  
    		mapViewControl.AddPushpin(position, data); // Set the data up in the map.  
    	}  
    }  
    

    }

    MapView.cs file

    public class MapView : Grid, INotifyPropertyChanged
    {
    private Bing.Maps.Map _map;
    private Bing.Maps.MapLayer _pinLayer;

    public string Credentials{...}  
    public string MapServiceToken{...}  
    public double Zoom{...}  
    
    public MapView()  
    {  
    	_map = new Map();  
            	_map.Language = lang; // this is taken from GlobalizationPreferences.Languages[0];  
            	  
    	_pinLayer = new MapLayer();  
            	//_pinLayer.Language = lang; // These were added later, but have no effect.  
            	_map.Children.Add(_pinLayer);  
    
            	this.Children.Add(_map);  
    }  
    
    public void AddPushpin(BasicGeoposition location, List<object> displayInfo, string text = "")  
    {  
    	CustomPin customPin = new CustomPin(); // a xaml control circle with a custom drawn tooltip  
    	customPin.DataContext = (CustomDataObject)displayInfo[0];  
    
    	Bing.Maps.MapLayer.SetPosition(customPin, location.ToLocation());  
                _pinLayer.Children.Add(customPin);	  
    }  
    

    }

    Also as mention in the original post

    In the application's OnLaunched() method

    ApplicationLanguages.PrimaryLanguageOverride is set to the current language (GlobalizationPreferences.Languages[0]) .

    Subsequently when we initialise the Bing.Maps.Map control we also set the Map.Language to be the same. This does not help.

    @AryaDing-MSFT

    (Are these Chinese language sets embedded with the Bing map control? How can we override to the devices preferred language?)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.