Is there an easy way to swap my imagery provider for a different imagery provider if the first throws an error?
E.G.: My map loads with imagery from Bing; if for whatever reason it can’t access imagery from Bing (I typed in my key wrong, whatever), I’d like it to access imagery from a USGS server.
You can use the imageryProvider’s readyPromise to listen for whether it was successfully created, and if not, you can remove it and add a different layer. Luckily there is one failing Bing layer in Sandcastle we can use to test:
var imageryProvider = new Cesium.BingMapsImageryProvider({