Bing Api key for Hello World

I set the key inside the BingMapsApi.js file but the globe still didn't appear. I also put the line "BingMapApi.defaultKey = 'Mykey' before the var viewer = new Cesium.Viewer('cesiumContainer') line without success.

Hello,

Try this:

Cesium.BingMapApi.defaultKey = ‘’;

Best,

Hannah

That should be:

Cesium.BingMapsApi.defaultKey = ‘’;

(Maps not Map)

Hi Kevin,
My key as shown above, I tried, in “Hello World.html” having the code as below but did not work. But the same key work for CesiumViewer.

function startup(Cesium) {
‘use strict’;
//Sandcastle_Begin

Cesium.BingMapsApi.defaultKey =’--------’;

var viewer = new Cesium.Viewer(‘cesiumContainer’);

//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== “undefined”) {
startup(Cesium);
} else if (typeof require === “function”) {
require([“Cesium”], startup);
}

Any idea why ?
Thanks

Cheers
TS

Hi TS,

The code you posted works just fine in Sandcastle for me. Here’s the example with our current bing key. Double check your key.

Hope that helps,

  • Rachel

Hi Rachel,
Thanks!
Working now.

Cheers
TS