Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: MapServiceToken not specified

I have been making an UWP app with the using a MapControl but when I run the app I get an error 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 have specified the MapServiceToken and I have also tried specifying it using C# with no luck.

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

I have used www.bingmapsportal.com to get my token but I have also tried using the Application ID and Authentication Token from the Windows Dev Center. Any Ideas?

like image 642
Robert Small Avatar asked Jul 30 '15 18:07

Robert Small


3 Answers

NOTE: For those who may be using older keys from Windows 8 platform

There seems to be an issue updating old keys to the Universal Windows Platform type. I had a key that was created in 2014, but even after I updated the key to Universal Windows it still would not authorize when I placed the key in the MapServiceToken value of the XAML. (it seems as though the value of the key itself never changes when you change the type on the key, even though it should update with a new value)

In order to solve this you have to create a brand new application key and use that value instead, and then the Warning message will go away.

like image 187
erotavlas Avatar answered Nov 05 '22 08:11

erotavlas


I got the same issue but here is my solution.

First navigate to https://www.bingmapsportal.com/Application. Find the link to create a new key.

On the form, fill in the Application type field. The available options are:

  • Dev/Test
  • Mobile Application
  • Website
  • Windows Application

Even though you are developing a Xamarin.Forms project (that is intuitively a kind of mobile app), you must choose Windows Application rather than Mobile Application. Why? The reason might be "UWP is an Windows Application". Period.

Failure doing so will trigger the warning.

like image 4
xport Avatar answered Nov 05 '22 08:11

xport


Sign into the Microsoft Dev account and navigate to this URI

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

Here the Key can be obtained for Universal.

It can be set in the XAML MapServiceToken, works fine!

like image 3
peterincumbria Avatar answered Nov 05 '22 08:11

peterincumbria