Warning: MapServiceToken not specified
Asked Answered
S

5

10

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?

Sarto answered 30/7, 2015 at 18:49 Comment(2)
Turns out that the service token that I was using wasn't for UWP. When I got the token UWP wasn't an option and it only became an option upon the release of windows 10.Sarto
I changed the type of my key (Universal Windows App) but I still have the warning. Have you solved your problem ?Jalisajalisco
Y
4

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.

Ye answered 29/5, 2016 at 19:10 Comment(0)
V
6

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.

Visitor answered 11/3, 2020 at 6:40 Comment(1)
I created key with application type Windows Application it worked without any warning. Thank you!Holoenzyme
Y
4

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.

Ye answered 29/5, 2016 at 19:10 Comment(0)
A
3

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!

Almaraz answered 24/1, 2016 at 14:25 Comment(0)
S
0

Also, you can sign in directly on 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 on XAML for MapControl using MapServiceToken property, the app crashed my computer. Then when I restarted it, the App run well. Oh dear me...

Slipstream answered 3/3, 2017 at 16:59 Comment(0)
B
0

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

Generate new key and add it in MapControl MapServiceToken. Its work for me.

Bluebird answered 22/6, 2019 at 12:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.