Changeset 366 for binary-improvements/webserver/leaflet/zoomslider
- Timestamp:
 - Jul 7, 2021, 2:07:20 PM (4 years ago)
 - File:
 - 
      
- 1 edited
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
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.
  ![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)