In a previous version of my application (which was built on OpenLayers 2.*), I had a requirement to show and hide imagery layers based on scale. I am trying to support this requirement on a Cesium version of the application.
I understand that Cesium doesn't support scale, and I am trying to figure out the best way to accomplish this.
Given some definition of what layers the user would like turned on (layer name), brightness, and alpha.
I am creating an imageryProvider from the layer definition, and then adding the WebServiceImageryProvider to the imageryLayers (collection).
for (i = 0; i < layers.length; i++) {
imageryProvider = new Cesium.WebMapServiceImageryProvider({
url: layers[i].url,
layers: [layers[i].name],
maximumLevel : layers[i].minScale,
minimumLevel : layers[i].maxScale,
proxy: new Cesium.DefaultProxy(config.proxyConfig.url),
parameters : {
transparent : (i === 0) ? false : layers[i].transparentLayer,
format : 'image/jpeg'
}
});
this.wmsImagery[layers[i].name] = this.scene.globe.imageryLayers.addImageryProvider(imageryProvider);
this.wmsImagery[layers[i].name].alpha = layers[i].opacity;
this.wmsImagery[layers[i].name].maximumLevel = layers[i].minScale;
this.wmsImagery[layers[i].name].minimumLevel = layers[i].maxScale;
}
From the api documentation I am not sure what the values for maximumLevel and minimumLevel represent and how they should be determined?
In the openlayers version, once a user zooms in or out (changes scale) I then need to determine which layers need to be show or hidden. I think this design holds true for the Cesium version of the application. The difference is that would need to determine the current level-of-detail and then compare that value against the maximumLevel and minimumLevel attributes to determine which imagery layer(s) would need to be shown or hidden?
Thanks in advance
Jerry