Changeset 366 for binary-improvements
- Timestamp:
- Jul 7, 2021, 2:07:20 PM (3 years ago)
- Location:
- binary-improvements/webserver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/webserver/js/map.js
r347 r366 40 40 zoomsliderControl: true, 41 41 attributionControl: false, 42 crs: SDTD_CRS 42 crs: SDTD_CRS, 43 // For the below options read section "Fractional zoom" here: https://leafletjs.com/examples/zoom-levels/ 44 zoomSnap: 1, // Defines the zoom levels that can be achieved at all 45 zoomDelta: 1, // Defines how much the zoom is changed with keyboard +/- and the zoom slider control 46 wheelPxPerZoomLevel: 60 // Defines how much mouse scrolling is needed per zoom level. If zoomDelta is e.g. 0.25 and you want the mouse scroll zoom to match that make this 4 times as high, i.e. 240 43 47 }).setView([0, 0], Math.max(0, mapinfo.maxzoom - 5)); 44 48 -
binary-improvements/webserver/leaflet/zoomslider/L.Control.Zoomslider.js
r173 r366 141 141 142 142 _zoomIn: function (e) { 143 this._map.zoomIn(e.shiftKey ? 3 : 1); 143 var delta = this._map.options.zoomDelta || 0; 144 this._map.zoomIn(e.shiftKey ? 3 * delta : delta); 144 145 }, 145 146 _zoomOut: function (e) { 146 this._map.zoomOut(e.shiftKey ? 3 : 1); 147 var delta = this._map.options.zoomDelta || 0; 148 this._map.zoomOut(e.shiftKey ? 3 * delta : delta); 147 149 }, 148 150 149 151 _zoomLevels: function () { 150 var zoomLevels = this._map.getMaxZoom() - this._map.getMinZoom()+ 1;152 var zoomLevels = (this._map.getMaxZoom() - this._map.getMinZoom()) / this._map.options.zoomDelta + 1; 151 153 return zoomLevels < Infinity ? zoomLevels : 0; 152 154 }, 153 155 _toZoomLevel: function (value) { 154 return value + this._map.getMinZoom();156 return value * this._map.options.zoomDelta + this._map.getMinZoom(); 155 157 }, 156 158 _toValue: function (zoomLevel) { 157 return zoomLevel - this._map.getMinZoom();159 return (zoomLevel - this._map.getMinZoom()) / this._map.options.zoomDelta; 158 160 }, 159 161
Note:
See TracChangeset
for help on using the changeset viewer.