I am "getting to know" Leaflet + TileStache, and wondering if there is a way to not have GeoJSON tile layers go back to the server on every single zoom level, but rather fetch every, say, 3 zoom levels … and instead do client-side clipping and zoom-level specific styling (like start rendering labels, etc). of features it already has loaded.
This would save a lot of traffic….
I see a similar question came up a while back:
but never seems to have been definitively resolved.
Best Answer
If we talk about L.tileLayer, which is raster, you can set it to be displayed only at desired zoom levels by setting
minZoom
's andmaxZoom
's, e.g.Example in codepen.io: http://codepen.io/dagmara223/pen/XpyYam
But for GeoJSON layer as far as I know, there are no native LeafletJS methods to set max/min zoom levels for it, at least not specified directly in the docs: http://leafletjs.com/reference-1.0.3.html