Sha256: 5afb39d0bd9ea0522aa74a5289a452c3000633a5abf2f600e7ef52da793b114c
Contents?: true
Size: 709 Bytes
Versions: 9
Compression:
Stored size: 709 Bytes
Contents
/* * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default. */ L.Map.mergeOptions({ doubleClickZoom: true }); L.Map.DoubleClickZoom = L.Handler.extend({ addHooks: function () { this._map.on('dblclick', this._onDoubleClick, this); }, removeHooks: function () { this._map.off('dblclick', this._onDoubleClick, this); }, _onDoubleClick: function (e) { var map = this._map, zoom = map.getZoom() + (e.originalEvent.shiftKey ? -1 : 1); if (map.options.doubleClickZoom === 'center') { map.setZoom(zoom); } else { map.setZoomAround(e.containerPoint, zoom); } } }); L.Map.addInitHook('addHandler', 'doubleClickZoom', L.Map.DoubleClickZoom);
Version data entries
9 entries across 9 versions & 1 rubygems