Closed alchenist closed 7 years ago
The more I think about it the more I am convinced that this belongs in the core leaflet package. Adding the plugin and deflating shapes is quite easy, but if we need compatibility with marker clustering, then the change needs to happen in the core leaflet plugin. cc @jcheng5.
I would have to do some research to make sure this is compatible with the layerManager. If it's adding and removing layers I'm worried it may not be.
Yep that's the reason why I think this needs to be in core leaflet, so that it's compatible with layerManager and ClusterControl both.
@jcheng5 I am thinking we could modify the layerManager to do what this plugin does for shape data. That way we can introduce this useful feature in a way that's idiomatic to the package. May be add deflateOption
to addPolygons
|addCircles
|addRectangles
|addPolylines
. Thoughts ?
I am moving this issue to core leaflet package. If this ever gets implemented I think it should be in the core package. For now, there's a round about way of doing this. In the leaflet package Github version we have groupOptions
which allows you to show/hide shapes/markers at different levels. So in theory you can add your shapes and corresponding markers in two different groups and assign them different zoom levels. That should get you similar results to the leaflet.deflate plugin.
This issue was moved to rstudio/leaflet#443
https://github.com/oliverroick/Leaflet.Deflate
"Deflates lines and polygons to a marker when their screen size becomes too small in lower zoom levels."