Before b10, I changed from Bing to OSM like:
cb.dayTileProvider = new Cesium.BingMapsTileProvider({server : ‘dev.virtualearth.net’});
And we simply switch to OSM with:
cb.dayTileProvider = new Cesium.BingMapsTileProvider({url : ‘http://tile.openstreetmap.org/’});
At b10 we use ImageryProviders and add them as layers:
cb.getImageryLayers().addImageryProvider({server: ‘dev.virtualearth.net’});
cb.getImageryLayers().addImageryProvider({url: ‘otile1.mqcdn.com/tiles/1.0.0/osm’});
What’s the right way to switch between them? Replace an existing one by deleting the old before adding the new, something like?
cb.getImageryLayers().remove(0)
cb.getImageryLayers().addImageryProvider({url: ‘otile1.mqcdn.com/tiles/1.0.0/osm’});
Or using toggling the .show attribute of the layer we want to hide and the one we want to show? This presumes we add all the layer we might be interested in up front, which seems like it could be a resource drain.
I’m looking at the SandCastle ImageryLayers example but a little distracted by the UI control manipulation vs. the display layers, and can’t find much in my generated docs about CentralBody.getImageryProvider() except:
prototype.getImageryLayers
Gets the collection of image layers that will be rendered on this central body.
Returns:
Thanks for all your patience and help.