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.
Starting in Leaflet 1.0, the
L.Control
class stores current layers as anArray ([]) versus an id-mapped Object ({}). This caused issues with
the current codebase as it expected to look up layers by their ID
using a simple property lookup.
In this commit I use the new Array style for storing layers but added
a helper method
_getLayer()
that is used to retrieve a layer by itsID. I replaced all layer accesses with this new method, which allows
the library to maintain both 0.7.x and 1.0+ compatibility.
To promote moving forward, I updated the examples to use the latest
Leaflet version (1.0.1). To help verify compatibility, I moved a copy
of the existing examples to a 0.7.x/ folder. I also updated the CDN
in the examples to use cdnjs.com (since the existing host did not
contain needed 1.0 libraries).