First version
This commit is contained in:
19
iFrameGPX/leaflet-wheelscroll/L.Control.MouseScroll.css
Normal file
19
iFrameGPX/leaflet-wheelscroll/L.Control.MouseScroll.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.leaflet-control-scrollzoom {
|
||||
text-indent: -999em;
|
||||
background-image: url(./imgs/wheel.png);
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
}
|
||||
.dark .leaflet-control-scrollzoom {
|
||||
background-image: url(./imgs/wheel-dark.png);
|
||||
}
|
||||
.leaflet-control-scrollzoom:focus {
|
||||
outline: 0;
|
||||
}
|
||||
.leaflet-control-scrollzoom.leaflet-disabled {
|
||||
background-image: url(./imgs/wheel_over.png);
|
||||
}
|
||||
.dark .leaflet-control-scrollzoom.leaflet-disabled {
|
||||
background-image: url(./imgs/wheel_over-dark.png);
|
||||
}
|
||||
44
iFrameGPX/leaflet-wheelscroll/L.Control.MouseScroll.js
Normal file
44
iFrameGPX/leaflet-wheelscroll/L.Control.MouseScroll.js
Normal file
@@ -0,0 +1,44 @@
|
||||
L.Control.MouseScroll = L.Control.Zoom.extend({
|
||||
options: {
|
||||
position: "topleft",
|
||||
mouseScrollText: "Zoom Molette",
|
||||
forceSeparateButton: false,
|
||||
mouseScrollTitle: "Zoom Molette"
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
var scrollZoom = "leaflet-control-scrollzoom"
|
||||
, container = L.DomUtil.create("div", scrollZoom + " leaflet-bar")
|
||||
, options = this.options
|
||||
|
||||
this._map = map
|
||||
|
||||
this._mouseScrollButton = this._createButton(options.mouseScrollText, options.mouseScrollTitle,
|
||||
scrollZoom, container, this._mouseScroll, this)
|
||||
|
||||
this._updateDisabled()
|
||||
map.on('focus', this._updateDisabled, this)
|
||||
|
||||
return container
|
||||
},
|
||||
|
||||
_mouseScroll: function () {
|
||||
if(this._map.scrollWheelZoom.enabled()) {
|
||||
this._map.scrollWheelZoom.disable();
|
||||
}
|
||||
else {
|
||||
this._map.scrollWheelZoom.enable();
|
||||
}
|
||||
},
|
||||
|
||||
_updateDisabled: function () {
|
||||
var map = this._map
|
||||
, className = "leaflet-disabled"
|
||||
|
||||
L.DomUtil.removeClass(this._mouseScrollButton, className)
|
||||
|
||||
if (!map.scrollWheelZoom.enabled()) {
|
||||
L.DomUtil.addClass(this._mouseScrollButton, className)
|
||||
}
|
||||
}
|
||||
})
|
||||
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel-dark.png
Normal file
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel-dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 571 B |
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel.png
Normal file
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 516 B |
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel_over-dark.png
Normal file
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel_over-dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 792 B |
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel_over.png
Normal file
BIN
iFrameGPX/leaflet-wheelscroll/imgs/wheel_over.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
Reference in New Issue
Block a user