I have a large map (eg: world) and I'm trying to implement loading elements from the server on 'moveend' events.
And I'm trying to offer up tools for doing this on 3 generations of map, so I'm putting the geometry that I'm loading into the current bounds into a layer group, and adding those layer groups to an L.control.layers control.
On when I load new geometry, I'm calling .removeLayer() on the layer control (which is problematic because I lose what layers the layer control thought was visible), but this doesn't appear to be removing the geometry from the map. However, removing the layer group from the map throws an error.
What's the best practice for trying to scroll around large datasets that are too big to fit in the browser, and/or: How do I better manage this geometry in my layer groups?
Thanks for any pointers,
Dan