Cesium 1.29 and Bing Maps key

714 views
Skip to first unread message

Jules d'As

unread,
Jan 6, 2017, 2:58:48 AM1/6/17
to cesium-dev
Hello,

Currently I use Cesium 1.29 and I got a key from BINGMAPS. But when I put "geocoder" to "True", there is a message showing that I use a default key as follows:

   This application is using Cesium's default Bing Maps key.
   Please create a new key for the application as soon as possible and prior to deployment
   By visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey
   Property before constructing the CesiumWidget or any other object that uses the Bing Maps API.


While I put "False", this message does not appear.


Here is my code for displaying Cesium:

var viewer = new Cesium.Viewer("idt", {
            timeline: true,
            animation: false,
            homeButton: false,
            screenModePicker: false,
            navigationHelpButton: false,
            baseLayerPicker: false,
            geocoder: true,//false
            sceneMode: Cesium.SceneMode.SCENE3D,
            imageryProvider: new Cesium.BingMapsImageryProvider({
                url: 'https://dev.virtualearth.net',
                mapStyle: Cesium.BingMapsStyle.AERIAL_WITH_LABELS,
                key: myKey
            })
        });


Thank you for your reply

Hannah Pinkos

unread,
Jan 6, 2017, 11:23:44 AM1/6/17
to cesium-dev
Hello,

You can set your bing maps key globally by setting 'Cesium.BingMapsApi.defaultKey = myKey' before you call 'new Cesuim.Viewer()'.  That way the key will be used for both the imagery and the geocoder.

Best,

Hannah

Jules d'As

unread,
Jan 9, 2017, 1:13:05 AM1/9/17
to cesiu...@googlegroups.com
Thank you.
It works.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/JkQ9T-HLkjw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages