putting bing map api key in Cesium.js


From the MS portal I have created the bing map key .

Now according to cesium.org/data_and_assets/imagery/bing-maps.html I should put the key using Cesium.BingMapsApi.defaultKey= …

I saw that as an edit in the Cesium.js file. However there are the minified file and there is a non-minified one in the cesium build folder.

My question is whether I should put the key in the minified file directly.




Hi Victor,

There is no need to modify any Cesium source file. Just out that line in your application code before the line that creates Cesium.Viewer.


Thanks Kevin!

I tried first to put that in inside the Sandcastle script function before the viewer but it did not work.
Putting the key in the Source/Core/BingMapsApi.js did work though.


I put the API in the line: "BingMapsApi.defaultKey =" in the BingMapsApi.js script and I am still only getting a starfield. Any ideas?

Did you put ‘your key’ after = after using the portal to create your key?

Right after the equal sign I put the API key in quotes

I put single quote ’ not " . Not sure if that mattered though.