small handlers refactoring
This commit is contained in:
parent
94ab90ae2f
commit
a69cb4df15
@ -3,9 +3,8 @@
|
||||
*/
|
||||
|
||||
L.Handler = L.Class.extend({
|
||||
initialize: function(map, enabled) {
|
||||
initialize: function(map) {
|
||||
this._map = map;
|
||||
if (enabled) { this.enable(); }
|
||||
},
|
||||
|
||||
enabled: function() {
|
||||
|
@ -3,11 +3,10 @@
|
||||
*/
|
||||
|
||||
L.Handler.ShiftDragZoom = L.Handler.extend({
|
||||
initialize: function(map, enabled) {
|
||||
initialize: function(map) {
|
||||
this._map = map;
|
||||
this._container = map._container;
|
||||
this._pane = map._panes.overlayPane;
|
||||
|
||||
L.Handler.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
|
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
L.Handler.TouchZoom = L.Handler.extend({
|
||||
|
||||
enable: function() {
|
||||
if (!L.Browser.mobileWebkit || this._enabled) { return; }
|
||||
L.DomEvent.addListener(this._map._container, 'touchstart', this._onTouchStart, this);
|
||||
|
@ -365,7 +365,8 @@ L.Map = L.Class.extend({
|
||||
};
|
||||
for (var i in handlers) {
|
||||
if (handlers.hasOwnProperty(i) && handlers[i]) {
|
||||
this[i] = new handlers[i](this, this.options[i]);
|
||||
this[i] = new handlers[i](this);
|
||||
if (this.options[i]) this[i].enable();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user