@nextgis/leaflet-map-adapter 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/leaflet-map-adapter.esm-browser.js +15 -3
- package/lib/leaflet-map-adapter.esm-browser.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.js +15 -3
- package/lib/leaflet-map-adapter.esm-bundler.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.global.js +15 -3
- package/lib/leaflet-map-adapter.global.js.map +1 -1
- package/lib/leaflet-map-adapter.global.prod.js +1 -1
- package/lib/leaflet-map-adapter.global.prod.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/leaflet-map-adapter; version: 2.2.
|
|
1
|
+
/** Bundle of @nextgis/leaflet-map-adapter; version: 2.2.3; author: NextGIS */
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { Control, DomEvent, GeoJSON, DivIcon, Marker, CircleMarker, FeatureGroup, ImageOverlay as ImageOverlay$1, Layer, Util, CRS, GridLayer, DomUtil, TileLayer as TileLayer$1, Map, latLngBounds, latLng } from 'leaflet';
|
|
4
4
|
import { defined, debounce as debounce$1 } from '@nextgis/utils';
|
|
@@ -295,12 +295,13 @@ class GeoJsonEvents {
|
|
|
295
295
|
constructor(layer) {
|
|
296
296
|
__publicField$6(this, "layer");
|
|
297
297
|
__publicField$6(this, "_onclick");
|
|
298
|
+
__publicField$6(this, "_ondblclick");
|
|
298
299
|
__publicField$6(this, "_mouseout");
|
|
299
300
|
__publicField$6(this, "_mouseover");
|
|
300
301
|
this.layer = layer;
|
|
301
302
|
}
|
|
302
303
|
handleMouseEvents(layer) {
|
|
303
|
-
const { onClick, onLayerClick, onMouseOut, onMouseOver } = this.layer.options;
|
|
304
|
+
const { onClick, onDoubleClick, onLayerClick, onMouseOut, onMouseOver } = this.layer.options;
|
|
304
305
|
const onClick_ = onClick || onLayerClick;
|
|
305
306
|
if (onClick_) {
|
|
306
307
|
this._onclick = (e) => {
|
|
@@ -311,6 +312,16 @@ class GeoJsonEvents {
|
|
|
311
312
|
};
|
|
312
313
|
layer.on("click", this._onclick, this);
|
|
313
314
|
}
|
|
315
|
+
if (onDoubleClick) {
|
|
316
|
+
this._ondblclick = (e) => {
|
|
317
|
+
DomEvent.stopPropagation(e);
|
|
318
|
+
const selected = !!this.layer._getSelected(layer);
|
|
319
|
+
onDoubleClick(__spreadValues$7({
|
|
320
|
+
selected
|
|
321
|
+
}, this._createMouseEvent(e)));
|
|
322
|
+
};
|
|
323
|
+
layer.on("dblclick", this._ondblclick, this);
|
|
324
|
+
}
|
|
314
325
|
if (onMouseOut) {
|
|
315
326
|
this._mouseout = (e) => {
|
|
316
327
|
onMouseOut(this._createMouseEvent(e));
|
|
@@ -1138,9 +1149,10 @@ class ImageOverlay extends ImageOverlay$1 {
|
|
|
1138
1149
|
super._initImage();
|
|
1139
1150
|
const headers = this.options.headers;
|
|
1140
1151
|
const img = this._image;
|
|
1152
|
+
const src = img.src;
|
|
1141
1153
|
img.src = "";
|
|
1142
1154
|
imageQueue$1.add(() => {
|
|
1143
|
-
const [promise, abortFunc] = callAjax(
|
|
1155
|
+
const [promise, abortFunc] = callAjax(src, headers);
|
|
1144
1156
|
promise.then((imgUrl) => {
|
|
1145
1157
|
img.src = imgUrl;
|
|
1146
1158
|
});
|