That’s a good question and one that I thought about (when I thought about fitting bounds to a group of markers). I know what I would like to do, but I don’t think I could make it work. Something like this seems natural:
// doesn't work
[leaflet-map]
[leaflet-group]
[leaflet-marker]
[leaflet-geojson ...]
[/leaflet-group]
For the marker problem I just added a property to the map to fit markers (fit_markers
), because it was easy to check the javascript property on the map and add an event listener whenever a marker was added. Maybe it makes sense that you’d want ALL shapes to be visible. So what I can propose is that I can add a new property, maybe in addition to fit_markers (and competing, I guess) that is fit_all
. What do you think? Basically the map would change views each time a new shape is loaded.