I have a PostGIS table that contains geometry, min_scale, and max_scale fields. The PostGIS table is published as a Geoserver layer with EPSG = 4326. I have created a CSS Style Doc that will show each geoemtry only in its scale range; something like:
[@sd <= max_scale] [@sd >= min_scale]{
mark: symbol(circle);
}
My problem is how to set the min_scale and max_scale fields to work properly with Openlayers zoom levels. I tried to use the scale values from the EPSG:4326 Gridset:
But it didn't work properly; for example if I set
min_scale = 545978 which corresponds to zoom 9
max_scale = 2183915 which corresponds to zoom 7
The feature appears only at zoom 7 and 8, and didn't appear at zoom 9.
I also tried the values at this table (Default Gridset):
https://docs.geoserver.org/latest/en/user/styling/ysld/reference/scalezoom.html#default-gridset But the same problem occurred.
My question is what is my problem? which scale values should I use in order to work properly with Openlayers zoom levels?