ol-cesium
ol-cesium copied to clipboard
Changing ol layer's source doesn't work in Cesium
As a developer, I'd like to be able to change layer's source.
I'm using ol to show Bing Maps. I have different ol sources for Road, Aerial and AerialWithLabels imagery sets. I have one ol layer so I can maintain the correct position/index all the time. Switching the layers imagery works by changing the source in ol, but the change doesn't get synchronized to Cesium.
Hi @jheijari, it is probably possible to handle this. See https://github.com/openlayers/ol-cesium/blob/master/src/olcs/AbstractSynchronizer.js.
When adding a layer we could listen for layer 'change:source' event and recreate the synchronized objects. However this is fairly low level and if you need this feature only for 1 layer you are probably better trying the following workaround:
- remove the layer form OpenLayers;
- add it back (same layer).