The New Bing Access javascript

I have been migrating to the new Cesium releases for several years. I just migrated to 1.72 and see the following console message

BingMapsApi.defaultKey is deprecated and will be removed in CesiumJS 1.73. Pass your access token directly to the BingMapsGeocoderService or BingMapsImageryProvider constructors.

I have not been able to find an example of where I can find to substitute HTML/javascript to use. Could you point me to one? Thanks.

Are you adding the Bing geocoder, or imagery directly to your viewer (using one of those classes mentioned in the console message)? If so, each has a constructor option where you can pass your access token, see https://cesium.com/docs/cesiumjs-ref-doc/BingMapsImageryProvider.html?classFilter=Imager.

That was way too easy.
Thank you!

1 Like

I started use:
imageryProvider : Cesium.createWorldImagery

rather than Bing. It seems, for example that the AERIAL views are the same. It there are situation where Bing would be a preferred choice?

Thanks,

@Jerrold_Siegel the createWorldImagery function is just a shorthand for Bing imagery right now (Cesium.IonResource.fromAssetId(2)), in the same way that Cesium.createWorldTerrain is a shorthand for Cesium.IonResource.fromAssetId(1).