mirror of
https://github.com/Leaflet/Leaflet.git
synced 2026-02-01 17:27:23 +00:00
22 lines
429 B
JavaScript
22 lines
429 B
JavaScript
/*
|
|
* L.Handler.DoubleClickZoom is used internally by L.Map to add double-click zooming.
|
|
*/
|
|
|
|
L.Map.mergeOptions({
|
|
doubleClickZoom: true
|
|
});
|
|
|
|
L.Map.DoubleClickZoom = L.Handler.extend({
|
|
addHooks: function () {
|
|
this._map.on('dblclick', this._onDoubleClick);
|
|
},
|
|
|
|
removeHooks: function () {
|
|
this._map.off('dblclick', this._onDoubleClick);
|
|
},
|
|
|
|
_onDoubleClick: function (e) {
|
|
this.setView(e.latlng, this._zoom + 1);
|
|
}
|
|
});
|