Loading geojson via ajax in leaflet using bbox and How to add a bounding box filter to this leaflet WFS request? both answer how to request vector layer data within a leaflet map by the map's bounding box. However both answers discard the vector layer's data when refreshing, with no caching of the results. I foresee some kind of merging olddata
and newdata
arrays while removing duplicates and then redrawing the layer.
I found the leaflet-tilelayer-geojson
plugin which creates a leaflet geojson layer from tiles of json, served from a request of URL http://{s}.somedomain.com/blabla/{z}/{x}/{y}.json
, but the plugin has not been updated for leaflet 1.0
Is there a commonly accepted method/plugin for caching this data?