Merge remote-tracking branch 'upstream/pull/2574'
This commit is contained in:
commit
bf9430f43e
2 changed files with 92 additions and 32 deletions
|
@ -11,13 +11,13 @@ folder 'vendor/assets' do
|
||||||
end
|
end
|
||||||
|
|
||||||
folder 'leaflet' do
|
folder 'leaflet' do
|
||||||
file 'leaflet.js', 'https://unpkg.com/leaflet@1.5.1/dist/leaflet-src.js'
|
file 'leaflet.js', 'https://unpkg.com/leaflet@1.6.0/dist/leaflet-src.js'
|
||||||
file 'leaflet.css', 'https://unpkg.com/leaflet@1.5.1/dist/leaflet.css'
|
file 'leaflet.css', 'https://unpkg.com/leaflet@1.6.0/dist/leaflet.css'
|
||||||
|
|
||||||
[ 'layers.png', 'layers-2x.png',
|
[ 'layers.png', 'layers-2x.png',
|
||||||
'marker-icon.png', 'marker-icon-2x.png',
|
'marker-icon.png', 'marker-icon-2x.png',
|
||||||
'marker-shadow.png' ].each do |image|
|
'marker-shadow.png' ].each do |image|
|
||||||
file "images/#{image}", "https://unpkg.com/leaflet@1.5.1/dist/images/#{image}"
|
file "images/#{image}", "https://unpkg.com/leaflet@1.6.0/dist/images/#{image}"
|
||||||
end
|
end
|
||||||
|
|
||||||
from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.0' do
|
from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.0' do
|
||||||
|
|
114
vendor/assets/leaflet/leaflet.js
vendored
114
vendor/assets/leaflet/leaflet.js
vendored
|
@ -1,6 +1,6 @@
|
||||||
/* @preserve
|
/* @preserve
|
||||||
* Leaflet 1.5.1+build.2e3e0ff, a JS library for interactive maps. http://leafletjs.com
|
* Leaflet 1.6.0, a JS library for interactive maps. http://leafletjs.com
|
||||||
* (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
(factory((global.L = {})));
|
(factory((global.L = {})));
|
||||||
}(this, (function (exports) { 'use strict';
|
}(this, (function (exports) { 'use strict';
|
||||||
|
|
||||||
var version = "1.5.1+build.2e3e0ffb";
|
var version = "1.6.0";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @namespace Util
|
* @namespace Util
|
||||||
|
@ -127,8 +127,8 @@ function falseFn() { return false; }
|
||||||
// @function formatNum(num: Number, digits?: Number): Number
|
// @function formatNum(num: Number, digits?: Number): Number
|
||||||
// Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.
|
// Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.
|
||||||
function formatNum(num, digits) {
|
function formatNum(num, digits) {
|
||||||
digits = (digits === undefined ? 6 : digits);
|
var pow = Math.pow(10, (digits === undefined ? 6 : digits));
|
||||||
return +(Math.round(num + ('e+' + digits)) + ('e-' + digits));
|
return Math.round(num * pow) / pow;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @function trim(str: String): String
|
// @function trim(str: String): String
|
||||||
|
@ -1906,7 +1906,7 @@ var msPointer = !window.PointerEvent && window.MSPointerEvent;
|
||||||
|
|
||||||
// @property pointer: Boolean
|
// @property pointer: Boolean
|
||||||
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
||||||
var pointer = !!(window.PointerEvent || msPointer);
|
var pointer = !webkit && !!(window.PointerEvent || msPointer);
|
||||||
|
|
||||||
// @property touch: Boolean
|
// @property touch: Boolean
|
||||||
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
||||||
|
@ -1927,6 +1927,23 @@ var mobileGecko = mobile && gecko;
|
||||||
// `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
|
// `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
|
||||||
var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
|
var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
|
||||||
|
|
||||||
|
// @property passiveEvents: Boolean
|
||||||
|
// `true` for browsers that support passive events.
|
||||||
|
var passiveEvents = (function () {
|
||||||
|
var supportsPassiveOption = false;
|
||||||
|
try {
|
||||||
|
var opts = Object.defineProperty({}, 'passive', {
|
||||||
|
get: function () {
|
||||||
|
supportsPassiveOption = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.addEventListener('testPassiveEventSupport', falseFn, opts);
|
||||||
|
window.removeEventListener('testPassiveEventSupport', falseFn, opts);
|
||||||
|
} catch (e) {
|
||||||
|
// Errors can safely be ignored since this is only a browser support test.
|
||||||
|
}
|
||||||
|
return supportsPassiveOption;
|
||||||
|
});
|
||||||
|
|
||||||
// @property canvas: Boolean
|
// @property canvas: Boolean
|
||||||
// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
|
// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
|
||||||
|
@ -1989,6 +2006,7 @@ var Browser = (Object.freeze || Object)({
|
||||||
mobileOpera: mobileOpera,
|
mobileOpera: mobileOpera,
|
||||||
mobileGecko: mobileGecko,
|
mobileGecko: mobileGecko,
|
||||||
retina: retina,
|
retina: retina,
|
||||||
|
passiveEvents: passiveEvents,
|
||||||
canvas: canvas,
|
canvas: canvas,
|
||||||
svg: svg,
|
svg: svg,
|
||||||
vml: vml
|
vml: vml
|
||||||
|
@ -2183,8 +2201,8 @@ function addDoubleTapListener(obj, handler, id) {
|
||||||
obj[_pre + _touchend + id] = onTouchEnd;
|
obj[_pre + _touchend + id] = onTouchEnd;
|
||||||
obj[_pre + 'dblclick' + id] = handler;
|
obj[_pre + 'dblclick' + id] = handler;
|
||||||
|
|
||||||
obj.addEventListener(_touchstart, onTouchStart, false);
|
obj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);
|
||||||
obj.addEventListener(_touchend, onTouchEnd, false);
|
obj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);
|
||||||
|
|
||||||
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
|
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
|
||||||
// the browser doesn't fire touchend/pointerup events but does fire
|
// the browser doesn't fire touchend/pointerup events but does fire
|
||||||
|
@ -2200,8 +2218,8 @@ function removeDoubleTapListener(obj, id) {
|
||||||
touchend = obj[_pre + _touchend + id],
|
touchend = obj[_pre + _touchend + id],
|
||||||
dblclick = obj[_pre + 'dblclick' + id];
|
dblclick = obj[_pre + 'dblclick' + id];
|
||||||
|
|
||||||
obj.removeEventListener(_touchstart, touchstart, false);
|
obj.removeEventListener(_touchstart, touchstart, passiveEvents ? {passive: false} : false);
|
||||||
obj.removeEventListener(_touchend, touchend, false);
|
obj.removeEventListener(_touchend, touchend, passiveEvents ? {passive: false} : false);
|
||||||
if (!edge) {
|
if (!edge) {
|
||||||
obj.removeEventListener('dblclick', dblclick, false);
|
obj.removeEventListener('dblclick', dblclick, false);
|
||||||
}
|
}
|
||||||
|
@ -2676,7 +2694,7 @@ function addOne(obj, type, fn, context) {
|
||||||
} else if ('addEventListener' in obj) {
|
} else if ('addEventListener' in obj) {
|
||||||
|
|
||||||
if (type === 'mousewheel') {
|
if (type === 'mousewheel') {
|
||||||
obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, passiveEvents ? {passive: false} : false);
|
||||||
|
|
||||||
} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
|
} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
|
||||||
handler = function (e) {
|
handler = function (e) {
|
||||||
|
@ -2721,7 +2739,7 @@ function removeOne(obj, type, fn, context) {
|
||||||
} else if ('removeEventListener' in obj) {
|
} else if ('removeEventListener' in obj) {
|
||||||
|
|
||||||
if (type === 'mousewheel') {
|
if (type === 'mousewheel') {
|
||||||
obj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
obj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, passiveEvents ? {passive: false} : false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
obj.removeEventListener(
|
obj.removeEventListener(
|
||||||
|
@ -4611,20 +4629,23 @@ var Map = Evented.extend({
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.on('load moveend', function () {
|
this.on('load moveend', this._animMoveEnd, this);
|
||||||
var c = this.getCenter(),
|
|
||||||
z = this.getZoom();
|
|
||||||
setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this._on('unload', this._destroyAnimProxy, this);
|
this._on('unload', this._destroyAnimProxy, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_destroyAnimProxy: function () {
|
_destroyAnimProxy: function () {
|
||||||
remove(this._proxy);
|
remove(this._proxy);
|
||||||
|
this.off('load moveend', this._animMoveEnd, this);
|
||||||
delete this._proxy;
|
delete this._proxy;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_animMoveEnd: function () {
|
||||||
|
var c = this.getCenter(),
|
||||||
|
z = this.getZoom();
|
||||||
|
setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));
|
||||||
|
},
|
||||||
|
|
||||||
_catchTransitionEnd: function (e) {
|
_catchTransitionEnd: function (e) {
|
||||||
if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {
|
if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {
|
||||||
this._onZoomTransitionEnd();
|
this._onZoomTransitionEnd();
|
||||||
|
@ -4674,6 +4695,7 @@ var Map = Evented.extend({
|
||||||
addClass(this._mapPane, 'leaflet-zoom-anim');
|
addClass(this._mapPane, 'leaflet-zoom-anim');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @section Other Events
|
||||||
// @event zoomanim: ZoomAnimEvent
|
// @event zoomanim: ZoomAnimEvent
|
||||||
// Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.
|
// Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.
|
||||||
this.fire('zoomanim', {
|
this.fire('zoomanim', {
|
||||||
|
@ -5307,7 +5329,7 @@ var Layers = Control.extend({
|
||||||
|
|
||||||
|
|
||||||
// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)
|
// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)
|
||||||
// Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
|
// Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
|
||||||
var layers = function (baseLayers, overlays, options) {
|
var layers = function (baseLayers, overlays, options) {
|
||||||
return new Layers(baseLayers, overlays, options);
|
return new Layers(baseLayers, overlays, options);
|
||||||
};
|
};
|
||||||
|
@ -7653,7 +7675,10 @@ var Marker = Layer.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_setPos: function (pos) {
|
_setPos: function (pos) {
|
||||||
|
|
||||||
|
if (this._icon) {
|
||||||
setPosition(this._icon, pos);
|
setPosition(this._icon, pos);
|
||||||
|
}
|
||||||
|
|
||||||
if (this._shadow) {
|
if (this._shadow) {
|
||||||
setPosition(this._shadow, pos);
|
setPosition(this._shadow, pos);
|
||||||
|
@ -7665,7 +7690,9 @@ var Marker = Layer.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateZIndex: function (offset) {
|
_updateZIndex: function (offset) {
|
||||||
|
if (this._icon) {
|
||||||
this._icon.style.zIndex = this._zIndex + offset;
|
this._icon.style.zIndex = this._zIndex + offset;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_animateZoom: function (opt) {
|
_animateZoom: function (opt) {
|
||||||
|
@ -7850,7 +7877,7 @@ var Path = Layer.extend({
|
||||||
setOptions(this, style);
|
setOptions(this, style);
|
||||||
if (this._renderer) {
|
if (this._renderer) {
|
||||||
this._renderer._updateStyle(this);
|
this._renderer._updateStyle(this);
|
||||||
if (this.options.stroke && style.hasOwnProperty('weight')) {
|
if (this.options.stroke && style && style.hasOwnProperty('weight')) {
|
||||||
this._updateBounds();
|
this._updateBounds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7920,9 +7947,13 @@ var CircleMarker = Path.extend({
|
||||||
// @method setLatLng(latLng: LatLng): this
|
// @method setLatLng(latLng: LatLng): this
|
||||||
// Sets the position of a circle marker to a new location.
|
// Sets the position of a circle marker to a new location.
|
||||||
setLatLng: function (latlng) {
|
setLatLng: function (latlng) {
|
||||||
|
var oldLatLng = this._latlng;
|
||||||
this._latlng = toLatLng(latlng);
|
this._latlng = toLatLng(latlng);
|
||||||
this.redraw();
|
this.redraw();
|
||||||
return this.fire('move', {latlng: this._latlng});
|
|
||||||
|
// @event move: Event
|
||||||
|
// Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.
|
||||||
|
return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});
|
||||||
},
|
},
|
||||||
|
|
||||||
// @method getLatLng(): LatLng
|
// @method getLatLng(): LatLng
|
||||||
|
@ -8669,6 +8700,9 @@ var GeoJSON = FeatureGroup.extend({
|
||||||
* @option coordsToLatLng: Function = *
|
* @option coordsToLatLng: Function = *
|
||||||
* A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
|
* A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
|
||||||
* The default is the `coordsToLatLng` static method.
|
* The default is the `coordsToLatLng` static method.
|
||||||
|
*
|
||||||
|
* @option markersInheritOptions: Boolean = false
|
||||||
|
* Whether default Markers for "Point" type Features inherit from group options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
initialize: function (geojson, options) {
|
initialize: function (geojson, options) {
|
||||||
|
@ -8718,9 +8752,13 @@ var GeoJSON = FeatureGroup.extend({
|
||||||
return this.addLayer(layer);
|
return this.addLayer(layer);
|
||||||
},
|
},
|
||||||
|
|
||||||
// @method resetStyle( <Path> layer ): this
|
// @method resetStyle( <Path> layer? ): this
|
||||||
// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
|
// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
|
||||||
|
// If `layer` is omitted, the style of all features in the current layer is reset.
|
||||||
resetStyle: function (layer) {
|
resetStyle: function (layer) {
|
||||||
|
if (layer === undefined) {
|
||||||
|
return this.eachLayer(this.resetStyle, this);
|
||||||
|
}
|
||||||
// reset any custom styles
|
// reset any custom styles
|
||||||
layer.options = extend({}, layer.defaultOptions);
|
layer.options = extend({}, layer.defaultOptions);
|
||||||
this._setLayerStyle(layer, this.options.style);
|
this._setLayerStyle(layer, this.options.style);
|
||||||
|
@ -8768,12 +8806,12 @@ function geometryToLayer(geojson, options) {
|
||||||
switch (geometry.type) {
|
switch (geometry.type) {
|
||||||
case 'Point':
|
case 'Point':
|
||||||
latlng = _coordsToLatLng(coords);
|
latlng = _coordsToLatLng(coords);
|
||||||
return pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng);
|
return _pointToLayer(pointToLayer, geojson, latlng, options);
|
||||||
|
|
||||||
case 'MultiPoint':
|
case 'MultiPoint':
|
||||||
for (i = 0, len = coords.length; i < len; i++) {
|
for (i = 0, len = coords.length; i < len; i++) {
|
||||||
latlng = _coordsToLatLng(coords[i]);
|
latlng = _coordsToLatLng(coords[i]);
|
||||||
layers.push(pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng));
|
layers.push(_pointToLayer(pointToLayer, geojson, latlng, options));
|
||||||
}
|
}
|
||||||
return new FeatureGroup(layers);
|
return new FeatureGroup(layers);
|
||||||
|
|
||||||
|
@ -8806,6 +8844,12 @@ function geometryToLayer(geojson, options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _pointToLayer(pointToLayerFn, geojson, latlng, options) {
|
||||||
|
return pointToLayerFn ?
|
||||||
|
pointToLayerFn(geojson, latlng) :
|
||||||
|
new Marker(latlng, options && options.markersInheritOptions && options);
|
||||||
|
}
|
||||||
|
|
||||||
// @function coordsToLatLng(coords: Array): LatLng
|
// @function coordsToLatLng(coords: Array): LatLng
|
||||||
// Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)
|
// Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)
|
||||||
// or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
|
// or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
|
||||||
|
@ -8889,6 +8933,7 @@ var PointToGeoJSON = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// @namespace Marker
|
// @namespace Marker
|
||||||
|
// @section Other methods
|
||||||
// @method toGeoJSON(precision?: Number): Object
|
// @method toGeoJSON(precision?: Number): Object
|
||||||
// `precision` is the number of decimal places for coordinates.
|
// `precision` is the number of decimal places for coordinates.
|
||||||
// The default value is 6 places.
|
// The default value is 6 places.
|
||||||
|
@ -9322,6 +9367,7 @@ var VideoOverlay = ImageOverlay.extend({
|
||||||
|
|
||||||
addClass(vid, 'leaflet-image-layer');
|
addClass(vid, 'leaflet-image-layer');
|
||||||
if (this._zoomAnimated) { addClass(vid, 'leaflet-zoom-animated'); }
|
if (this._zoomAnimated) { addClass(vid, 'leaflet-zoom-animated'); }
|
||||||
|
if (this.options.className) { addClass(vid, this.options.className); }
|
||||||
|
|
||||||
vid.onselectstart = falseFn;
|
vid.onselectstart = falseFn;
|
||||||
vid.onmousemove = falseFn;
|
vid.onmousemove = falseFn;
|
||||||
|
@ -9379,9 +9425,12 @@ function videoOverlay(video, bounds, options) {
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* var element = '<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image xlink:href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/></svg>',
|
* var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
* elementBounds = [ [ 32, -130 ], [ 13, -100 ] ];
|
* svgElement.setAttribute('xmlns', "http://www.w3.org/2000/svg");
|
||||||
* L.svgOverlay(element, elementBounds).addTo(map);
|
* svgElement.setAttribute('viewBox', "0 0 200 200");
|
||||||
|
* svgElement.innerHTML = '<rect width="200" height="200"/><rect x="75" y="23" width="50" height="50" style="fill:red"/><rect x="75" y="123" width="50" height="50" style="fill:#0013ff"/>';
|
||||||
|
* var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];
|
||||||
|
* L.svgOverlay(svgElement, svgElementBounds).addTo(map);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -9391,6 +9440,7 @@ var SVGOverlay = ImageOverlay.extend({
|
||||||
|
|
||||||
addClass(el, 'leaflet-image-layer');
|
addClass(el, 'leaflet-image-layer');
|
||||||
if (this._zoomAnimated) { addClass(el, 'leaflet-zoom-animated'); }
|
if (this._zoomAnimated) { addClass(el, 'leaflet-zoom-animated'); }
|
||||||
|
if (this.options.className) { addClass(el, this.options.className); }
|
||||||
|
|
||||||
el.onselectstart = falseFn;
|
el.onselectstart = falseFn;
|
||||||
el.onmousemove = falseFn;
|
el.onmousemove = falseFn;
|
||||||
|
@ -12112,7 +12162,7 @@ var Canvas = Renderer.extend({
|
||||||
_initContainer: function () {
|
_initContainer: function () {
|
||||||
var container = this._container = document.createElement('canvas');
|
var container = this._container = document.createElement('canvas');
|
||||||
|
|
||||||
on(container, 'mousemove', throttle(this._onMouseMove, 32, this), this);
|
on(container, 'mousemove', this._onMouseMove, this);
|
||||||
on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this);
|
on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this);
|
||||||
on(container, 'mouseout', this._handleMouseOut, this);
|
on(container, 'mouseout', this._handleMouseOut, this);
|
||||||
|
|
||||||
|
@ -12422,10 +12472,15 @@ var Canvas = Renderer.extend({
|
||||||
removeClass(this._container, 'leaflet-interactive');
|
removeClass(this._container, 'leaflet-interactive');
|
||||||
this._fireEvent([layer], e, 'mouseout');
|
this._fireEvent([layer], e, 'mouseout');
|
||||||
this._hoveredLayer = null;
|
this._hoveredLayer = null;
|
||||||
|
this._mouseHoverThrottled = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleMouseHover: function (e, point) {
|
_handleMouseHover: function (e, point) {
|
||||||
|
if (this._mouseHoverThrottled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var layer, candidateHoveredLayer;
|
var layer, candidateHoveredLayer;
|
||||||
|
|
||||||
for (var order = this._drawFirst; order; order = order.next) {
|
for (var order = this._drawFirst; order; order = order.next) {
|
||||||
|
@ -12448,6 +12503,11 @@ var Canvas = Renderer.extend({
|
||||||
if (this._hoveredLayer) {
|
if (this._hoveredLayer) {
|
||||||
this._fireEvent([this._hoveredLayer], e);
|
this._fireEvent([this._hoveredLayer], e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._mouseHoverThrottled = true;
|
||||||
|
setTimeout(L.bind(function () {
|
||||||
|
this._mouseHoverThrottled = false;
|
||||||
|
}, this), 32);
|
||||||
},
|
},
|
||||||
|
|
||||||
_fireEvent: function (layers, e, type) {
|
_fireEvent: function (layers, e, type) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue