More

Reusing tiles between zoom levels of Leaflet?

Reusing tiles between zoom levels of Leaflet?


I have a Leaflet map with a GeoJSON Tile Layer and a custom backend for serving geoJSON tiles. The geometries returned from the backend are simplified depending on the zoom level, but within certain bins of zoom levels (1-3, 4-6, etc) the geometries are identical. Right now, new tiles will be fetched for every single zoom level, and I was wondering whether there is a way to reuse tiles when going to a zoom level within the same bin. This would decrease the server load and reduce flickering when zooming in or out.

For example: when going from zoom level 4 to zoom level 5, no new tiles should be fetched and the existing tiles should be stretched. Likewise, when going from zoom level 5 to zoom level 4, the existing tiles should be kept and additional tiles should be fetched to complete the map.

Any thoughts?


May be It depends up on back end for serving geojson. Just it varies for different back end serving capabilities. Just change the serving back end and observe the result. In leaflet the layer is load once from the back end and we can do more functionalities available for manipulating the layer.