New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layer refactoring #2266
Layer refactoring #2266
Conversation
@danzel @tmcw @jfirebaugh now merged in master, take a look, or just skim through the summary of changes in the description. |
|
||
getPane: function (name) { | ||
// TODO make pane if not present | ||
var paneName = name ? this.options[name] || name : this.options.pane; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some brackets here would make this a bit more readable:
var paneName = name ? (this.options[name] || name) : this.options.pane;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're right :)
Read through, looks good |
Thanks! |
A work in progress. This PR contains major refactoring of Leaflet layers architecture, creating a base Layer class for all layers to inherit from, and putting all shared layers logic there (as well as layers-related logic in
Map.js
), DRYing up and simplifying the code significantly, removing ugly hacks, as well as addressing #496 #1249 #1742 and other issues. A part of the major refactoring for Leaflet 1.0 #2210.Layer
class which all layers added to a map should inherit from.add
andremove
events to all layers.pane
option to all layers that can be changed (e.g. you can setpane: 'overlayPane'
to a tile layer).shadowPane
option to markers as well.getEvents
method to all layers that returns an{event: listener, ...}
hash; layers now manage its listeners automatically without having to do this inonAdd
/onRemove
.FeatureGroup
getBounds
to work correctly when containing circle markers.Map
tilelayersload
event.Popup
open
andclose
events in favor ofadd
andremove
for consistency.Map.js
toLayer.js
.