@nextgis/leaflet-map-adapter 2.2.2 → 2.3.0

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/leaflet-map-adapter; version: 2.2.2; author: NextGIS */
1
+ /** Bundle of @nextgis/leaflet-map-adapter; version: 2.3.0; author: NextGIS */
2
2
  var LeafletMapAdapter = (function () {
3
3
  'use strict';
4
4
 
@@ -14761,10 +14761,7 @@ var LeafletMapAdapter = (function () {
14761
14761
 
14762
14762
  var __defProp$c = Object.defineProperty;
14763
14763
  var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14764
- var __publicField$8 = (obj, key, value) => {
14765
- __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
14766
- return value;
14767
- };
14764
+ var __publicField$8 = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
14768
14765
  class BaseAdapter {
14769
14766
  constructor(map, options) {
14770
14767
  this.map = map;
@@ -14846,20 +14843,18 @@ var LeafletMapAdapter = (function () {
14846
14843
  }
14847
14844
  return a;
14848
14845
  };
14849
- var __publicField$7 = (obj, key, value) => {
14850
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
14851
- return value;
14852
- };
14846
+ var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
14853
14847
  class GeoJsonEvents {
14854
14848
  constructor(layer) {
14855
14849
  __publicField$7(this, "layer");
14856
14850
  __publicField$7(this, "_onclick");
14851
+ __publicField$7(this, "_ondblclick");
14857
14852
  __publicField$7(this, "_mouseout");
14858
14853
  __publicField$7(this, "_mouseover");
14859
14854
  this.layer = layer;
14860
14855
  }
14861
14856
  handleMouseEvents(layer) {
14862
- const { onClick, onLayerClick, onMouseOut, onMouseOver } = this.layer.options;
14857
+ const { onClick, onDoubleClick, onLayerClick, onMouseOut, onMouseOver } = this.layer.options;
14863
14858
  const onClick_ = onClick || onLayerClick;
14864
14859
  if (onClick_) {
14865
14860
  this._onclick = (e) => {
@@ -14870,6 +14865,16 @@ var LeafletMapAdapter = (function () {
14870
14865
  };
14871
14866
  layer.on("click", this._onclick, this);
14872
14867
  }
14868
+ if (onDoubleClick) {
14869
+ this._ondblclick = (e) => {
14870
+ leafletSrcExports.DomEvent.stopPropagation(e);
14871
+ const selected = !!this.layer._getSelected(layer);
14872
+ onDoubleClick(__spreadValues$7({
14873
+ selected
14874
+ }, this._createMouseEvent(e)));
14875
+ };
14876
+ layer.on("dblclick", this._ondblclick, this);
14877
+ }
14873
14878
  if (onMouseOut) {
14874
14879
  this._mouseout = (e) => {
14875
14880
  onMouseOut(this._createMouseEvent(e));
@@ -14946,10 +14951,7 @@ var LeafletMapAdapter = (function () {
14946
14951
  }
14947
14952
  return target;
14948
14953
  };
14949
- var __publicField$6 = (obj, key, value) => {
14950
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
14951
- return value;
14952
- };
14954
+ var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
14953
14955
  class GeoJsonPaint {
14954
14956
  constructor(layer) {
14955
14957
  __publicField$6(this, "layer");
@@ -15098,10 +15100,7 @@ var LeafletMapAdapter = (function () {
15098
15100
  return a;
15099
15101
  };
15100
15102
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
15101
- var __publicField$5 = (obj, key, value) => {
15102
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
15103
- return value;
15104
- };
15103
+ var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
15105
15104
  var __async = (__this, __arguments, generator) => {
15106
15105
  return new Promise((resolve, reject) => {
15107
15106
  var fulfilled = (value) => {
@@ -15688,10 +15687,7 @@ var LeafletMapAdapter = (function () {
15688
15687
 
15689
15688
  var __defProp$7 = Object.defineProperty;
15690
15689
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15691
- var __publicField$4 = (obj, key, value) => {
15692
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
15693
- return value;
15694
- };
15690
+ var __publicField$4 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
15695
15691
  class Queue {
15696
15692
  /**
15697
15693
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
@@ -15777,14 +15773,10 @@ var LeafletMapAdapter = (function () {
15777
15773
  }
15778
15774
 
15779
15775
  const imageQueue = new Queue({ concurrency: 6, delay: 200 });
15780
- var imageQueue$1 = imageQueue;
15781
15776
 
15782
15777
  var __defProp$6 = Object.defineProperty;
15783
15778
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15784
- var __publicField$3 = (obj, key, value) => {
15785
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
15786
- return value;
15787
- };
15779
+ var __publicField$3 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
15788
15780
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
15789
15781
  constructor(imageUrl, bounds, options) {
15790
15782
  super(imageUrl, bounds, options);
@@ -15802,7 +15794,7 @@ var LeafletMapAdapter = (function () {
15802
15794
  const img = this._image;
15803
15795
  const src = img.src;
15804
15796
  img.src = "";
15805
- imageQueue$1.add(() => {
15797
+ imageQueue.add(() => {
15806
15798
  const [promise, abortFunc] = callAjax(src, headers);
15807
15799
  promise.then((imgUrl) => {
15808
15800
  img.src = imgUrl;
@@ -15815,10 +15807,7 @@ var LeafletMapAdapter = (function () {
15815
15807
 
15816
15808
  var __defProp$5 = Object.defineProperty;
15817
15809
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15818
- var __publicField$2 = (obj, key, value) => {
15819
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
15820
- return value;
15821
- };
15810
+ var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
15822
15811
  class ImageLayer extends leafletSrcExports.Layer {
15823
15812
  constructor(url, options) {
15824
15813
  super(options);
@@ -16022,10 +16011,7 @@ var LeafletMapAdapter = (function () {
16022
16011
  }
16023
16012
  return a;
16024
16013
  };
16025
- var __publicField$1 = (obj, key, value) => {
16026
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
16027
- return value;
16028
- };
16014
+ var __publicField$1 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
16029
16015
  class ImageAdapter extends BaseAdapter {
16030
16016
  constructor() {
16031
16017
  super(...arguments);
@@ -16052,7 +16038,7 @@ var LeafletMapAdapter = (function () {
16052
16038
  }
16053
16039
  }
16054
16040
  }
16055
- __publicField$1(ImageAdapter, "queue", imageQueue$1);
16041
+ __publicField$1(ImageAdapter, "queue", imageQueue);
16056
16042
 
16057
16043
  function makeRemote(Base) {
16058
16044
  return class RemoteTileLayer extends Base {
@@ -16303,10 +16289,7 @@ var LeafletMapAdapter = (function () {
16303
16289
  }
16304
16290
  return a;
16305
16291
  };
16306
- var __publicField = (obj, key, value) => {
16307
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
16308
- return value;
16309
- };
16292
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
16310
16293
  const _LeafletMapAdapter = class _LeafletMapAdapter {
16311
16294
  constructor() {
16312
16295
  __publicField(this, "options", { target: "map" });
@@ -16384,8 +16367,7 @@ var LeafletMapAdapter = (function () {
16384
16367
  }
16385
16368
  setView(lngLatOrOpt, zoom) {
16386
16369
  const map = this.map;
16387
- if (!map)
16388
- return;
16370
+ if (!map) return;
16389
16371
  if (Array.isArray(lngLatOrOpt)) {
16390
16372
  const lngLat = lngLatOrOpt;
16391
16373
  const [lng, lat] = lngLat;
@@ -16453,8 +16435,7 @@ var LeafletMapAdapter = (function () {
16453
16435
  return (_a = this.map && this.map.getZoom()) != null ? _a : void 0;
16454
16436
  }
16455
16437
  getBounds() {
16456
- if (!this.map)
16457
- return void 0;
16438
+ if (!this.map) return void 0;
16458
16439
  const b = this.map.getBounds();
16459
16440
  const sw = b.getSouthWest();
16460
16441
  const ne = b.getNorthEast();