Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Edit (2016-04-02):
Split the LayersControl code into a new branch, rebased to d057013, removed the built files, and filterd out the
layerContainer
prop everywhere from the layer options objects (same as themap
prop).This is a two-part PR.The first part is the
layerContainer
prop.Until now a
MapLayer
could receive either amap
or alayerGroup
prop. With this PR aMapLayer
always receives both themap
and thelayerContainer
props. Themap
is always the same, and thelayerContainer
is either themap
or the oldlayerGroup
.This way all the map layers have access to the root
Map
instance, and other kind of layer containers can be introduced less intrusively.The second is a LayersControl implementation for #87 that makes use of thelayerContainer
prop.This uses a HoC for the child layers, and acts as a layers container.I haven't tested it thoroughly, but for my use case it seems to be working.The readme includes an example.