Warning: MapServiceToken is not specified.

I am making a UWP application using MapControl, but when I start the application, I get an error message in the bottom corner saying "Warning: MapServiceToken not specified". The XAML I am using is as follows:

<Maps:MapControl x:Name="MapControl1" Loaded="mapLoaded" ZoomLevelChanged="mapZoomChanged" MapServiceToken="AqK9nK0h_LngGSC8pHPzBJvl62yf617zRytgimB3fyYqdJPljcB-EGm3llmUUrlI"/> 

As you can see, I pointed out MapServiceToken, and I also tried to specify it using C # with no luck.

 MapService.ServiceToken = "AqK9nK0h_LngGSC8pHPzBJvl62yf617zRytgimB3fyYqdJPljcB-EGm3llmUU..."; MapControl1.MapServiceToken = "AqK9nK0h_LngGSC8pHPzBJvl62yf617zRytgimB3fyYqdJPljcB-EGm3llmU..."; 

I used www.bingmapsportal.com to get my token, but I also tried using the application identifier and authentication token in Windows Dev Center. Any ideas?

+6
source share
4 answers

NOTE. For those who can use old keys from the Windows 8 platform

There seems to be a problem with updating old keys for the universal Windows platform. I had a key that was created in 2014, but even after I updated the key for Universal Windows, it still did not allow it when I put the key in the MapServiceToken value for XAML. (it seems that the value of the key itself never changes when the type on the key changes, although it should be updated with the new value)

To solve this problem, you need to create a new application key and use this value, and then the warning message will disappear.

+3
source

Log in to your Microsoft Dev account and browse to this URI

https://www.bingmapsportal.com/Application#

Here the Key can be obtained for Universal.

It can be installed in XAML MapServiceToken, works great!

+3
source

In addition, you can log in directly to Bing Maps to generate a key.

https://www.bingmapsportal.com/

My account → My keys

For UWP, this key is quite long.

FYI, when I added the key to XAML for MapControl using the MapServiceToken property, the application crashed my computer. Then, when I restarted it, the application works well. Oh my God...

0
source

Read the Microsoft documentation https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/authentication-key

Generate a new key and add it to MapControl MapServiceToken. This is a job for me.

0
source

All Articles