Closed jgoux closed 8 years ago
Hi, No, this is not supported yet, probably in a future release.
How would this be different from your LayerGroup implementation? I was planning on trying to get this syntax working for FeatureGroup this weekend (and then opening a pull request).
@bradsimantel It has the getBounds()
function which will allow me to center my map based on the elements' coordinates inside the FeatureGroup
Disclamer: I'm a total newbie with Leaflet, maybe there is an easier solution for my case. :)
@jgoux: Sorry for the miscommunication! I understand that Leaflet's FeatureGroup has some useful methods that differentiate it from LayerGroup. I was trying to ask @PaulLeCam how he thinks a component wrapper around FeatureGroup that allows for child Marker components might be different from the current wrapper around LayerGroup.
Hi,
I created a new branch to have the FeatureGroup
work like LayerGroup
: https://github.com/PaulLeCam/react-leaflet/tree/feature-group
The main differences from LayerGroup
is that it needs to pass the popupContainer
prop to its children, so that the Popup
s can bind to it, and support the style props, as they can be applied to its children using setStyle
It seems to work for a very simple use case (https://github.com/PaulLeCam/react-leaflet/blob/feature-group/example/other-layers.js#L34) but it needs lots of tests for different cases, on the top of my head:
FeatureGroup
s? FeatureGroup
in LayerGroup
? LayerGroup
in FeatureGroup
?FeatureGroup
styles override its children? If so, every time? Only if changed dynamically?Popup
?Please let me know if you're playing around with this branch and have any issue and answers to these questions!
This is awesome, @PaulLeCam! Thanks so much! I'll post updates as I try stuff.
Hi,
I added it to v0.9, please let me know if you have any issue with it!
Hello, is it possible to declare FeatureGroup's layers like LayerGroup ? Example :