continuous zooming in editor
This commit is contained in:
parent
49c484eff8
commit
e965983322
1 changed files with 13 additions and 1 deletions
|
@ -12,7 +12,7 @@ editor = {
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
crs: L.CRS.Simple,
|
crs: L.CRS.Simple,
|
||||||
editable: true,
|
editable: true,
|
||||||
closePopupOnClick: false
|
zoomSnap: 0
|
||||||
});
|
});
|
||||||
if (L.Browser.chrome && !('ontouchstart' in window)) {
|
if (L.Browser.chrome && !('ontouchstart' in window)) {
|
||||||
$('.leaflet-touch').removeClass('leaflet-touch');
|
$('.leaflet-touch').removeClass('leaflet-touch');
|
||||||
|
@ -21,6 +21,18 @@ editor = {
|
||||||
editor.map.on('click', function () {
|
editor.map.on('click', function () {
|
||||||
editor.map.doubleClickZoom.enable();
|
editor.map.doubleClickZoom.enable();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fix scroll wheel zoom on precise scrolling devices
|
||||||
|
*/
|
||||||
|
var originalPerformZoom = L.Map.ScrollWheelZoom.prototype._performZoom;
|
||||||
|
L.Map.ScrollWheelZoom.include({
|
||||||
|
_performZoom: function () {
|
||||||
|
if (this._delta) this._delta = (this._delta > 0) ? Math.max(this._delta, 60) : Math.min(this._delta, -60);
|
||||||
|
originalPerformZoom.call(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
window.onbeforeunload = editor._onbeforeunload;
|
window.onbeforeunload = editor._onbeforeunload;
|
||||||
|
|
||||||
L.control.scale({imperial: false}).addTo(editor.map);
|
L.control.scale({imperial: false}).addTo(editor.map);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue