Skip to content

When redrawing when it is not necessary, queries with NaN values are lost

Hello, thank you for your work in the difficult fate of leaflet in vector tiles. I have a problem, I have this configuration for my layer

const layer = vectorTileLayer(VECTOR_LAYER_TEMPLATE_URL, {
        minZoom: 16,
        maxZoom: 23,
        style: {
          weight: 2,
          color: '#94cb24',
          opacity: 1,
          fillColor: '#94cb24',
          fillOpacity: 0.1,
        },
    }
);

I have explicitly limited the minimum and maximum zoom, but if I am not in the range of this zoom, and call layer.redraw(); then I start getting requests like this

http://some.geoserv.com/geoserver/gwc/service/tms/1.0.0/some_source:some_layer@EPSG%3A900913@pbf/13/NaN/NaN.pbf

That is, the zoom is specified (in fact, the layer is not available at this zoom), but the package still tries to request squares with coordinates equal to NaN. I can get around this with my own solution and check the zoom every time I need to redraw, but I think the best solution would be to limit this within the package.

What do you think ?

PS: My first idea was to find a function to check whether the layer is available for display at this moment, but there is no such magic function(

Edited by Tkachenko Kirill