Select to view content in your preferred language

Support for Bing Maps "key" instead of clienttoken/tokenurl.

1052
8
06-22-2010 04:29 PM
DrewMillen
Deactivated User
Hi There,

As I understand it, the use of the token property is no longer the preferred method for accessing Bing Maps services.  In the place of tokens, it is recommended that developers use a "Bing Maps Key".  This is described here:

http://msdn.microsoft.com/en-us/library/cc980937.aspx
(see the "Note" section)

and there's also a related thread on the Silverlight API forum here:

http://forums.arcgis.com/threads/4482-Bing-Service

From the forum link above:
"The staging servers has been deprecated by Microsoft, including their token service. The good news is that it has gotten a lot simpler now. Instead, go to www.bingmapsportal.com sign up, log in and generate a token/app id. This token doesn't expire."

I see that the Flex API and Silverlight API have both been updated to accept the "key" property belonging to the esri.virtualearth.VETiledLayer class.

I would like to start using the 'key' in place of tokens in my applications.  Are there plans to update the ESRI JavaScript API in order to support the new way of connecting to Bing Maps services?

If so, do you have a timeline in mind?

Thank you in advance for any insight you may be able to provide.

Drew.
0 Kudos
8 Replies
AdamPfister
Esri Contributor
after i generated my key, this bit of code works fine for me:

var veLayer = new esri.virtualearth.VETiledLayer({
[INDENT]clientToken: 'devKey',
serverToken: 'devKey',
environment: 'staging',
mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL_WITH_LABELS[/INDENT]
});
map.addLayer(veLayer);


using v2.0
0 Kudos
DrewMillen
Deactivated User
Thanks!  This works, although it feels like a bit of a workaround: overloading properties which are 'supposed' to do something entirely different.

At any rate, your solution worked for me too (although I set the environment to "production" instead).
0 Kudos
AdamPfister
Esri Contributor
i agree it's a workaround.  maybe they'll be an update for 2.0 final?
0 Kudos
KellyHutchins
Esri Frequent Contributor
At 2.0 Final the JavaScript API will be updated to have a bingMapsKey property.
0 Kudos
TorrinHultgren
Occasional Contributor
Our sites just started throwing errors "BingMapsKey must be provided."  We've got a Bing Maps Key of our own, but neither ajpfister06's code, nor simply adding our key as a "BingMapsKey" parameter to our VETiledLayer initialization seems to be working today.  Was there a plan to include documentation of this new requirement at some point, or are we forced us to switch back to v1.6 to maintain a working site?
0 Kudos
KellyHutchins
Esri Frequent Contributor
Here is a link to a help topic that explains how to work with the bing maps keys.
http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/ve_getting_started.h...
And here's a link to a sample that shows this in action:
http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/ve/ve_layer.html
0 Kudos
TorrinHultgren
Occasional Contributor
Ahhh, those links are very helpful - I was led astray by all the links on this page

http://resources.esri.com/help/webapi/javascript/arcgis/index.html

which include only the old documentation.  Thanks for clearing that up, perhaps a redirect on that older page might be in order?
0 Kudos
KeithSandell
Regular Contributor
At 2.0 Final the JavaScript API will be updated to have a bingMapsKey property.


Does AGS 10 for the Java platform include this functionality. In 9.3.1, and I guess previous, releases of AGS there is "no" function within AGS manager to set anything for Bing?

Thanks

Keith
0 Kudos