[GIS] How to change layers visibility while I zoom in GeoServer

geoserverlayersopenlayerszoom

I want to change layers visibility while I zoom , here are my screenshots.

where is my error ?

Best Answer

You appear to be trying to turn off/on Layer Visibility in GeoWebCache which is integrated with GeoWebServer. Geowebcache is used for caching tiles to improve speed, not controlling layer visibility

There are two ways to handle layer visibility

  1. Style the Layer using SLD in GEoserver, using<MinScaleDenominator></MinScaleDenominator> and <MaxScaleDenominator></MaxScaleDenominator> to control the display of features

  2. Use the OpenLayers setVisibility() function to turn he layers off.