openlayers / ol-cesium

OpenLayers - Cesium integration
http://openlayers.org/ol-cesium/
BSD 2-Clause "Simplified" License
970 stars 322 forks source link

Add minimumLevel option for WMS layers #1119

Open mvoermans opened 8 months ago

mvoermans commented 8 months ago

Some layers are only visible at some levels. Is is possible to set the minimumLevel like olcs.projection as an extra setting.

gberaudo commented 8 months ago

Hi @mvoermans,

Cesium is loading all tiles at minimumLevel at startup. If you are displaying only a small extent you can define a rectangle and bump this value accordingly.

Maybe that could be implemented with a https://cesium.com/learn/cesiumjs/ref-doc/TileDiscardPolicy.html

mvoermans commented 7 months ago

Hi @gberaudo,

Thanks for your response!

I think that won't fix my problem. I have an WMS layer with a min and max resolution like in this example: https://openlayers.org/en/latest/examples/min-max-resolution.html When I open this layer in Cesium and I zoom out of the resolution settings, Cesium still send WMS requests.

If I look at the Cesium documentation: https://cesium.com/learn/cesiumjs/ref-doc/WebMapServiceImageryProvider.html#.ConstructorOptions I see there is a minimumLevel and maximumLevel setting.

Is it possible with OLCesium to set this setting for a WMS layer?

gberaudo commented 7 months ago

Hi @mvoermans, the documentation you points says: """ The minimum level-of-detail supported by the imagery provider. Take care when specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely to result in rendering problems. """

I am not aware of a mechanism similar to OL in Cesium. If you find something please report it here so that we can integrate it.