@nextgis/leaflet-map-adapter 2.2.3 → 3.0.0-alpha.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.
- package/lib/leaflet-map-adapter.esm-browser.js +14 -44
- 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 +13 -40
- 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 +14 -44
- 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 +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/leaflet-map-adapter; version:
|
|
1
|
+
/** Bundle of @nextgis/leaflet-map-adapter; version: 3.0.0-alpha.0; 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';
|
|
@@ -202,10 +202,7 @@ function createFeaturePositionOptions(features) {
|
|
|
202
202
|
|
|
203
203
|
var __defProp$b = Object.defineProperty;
|
|
204
204
|
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
205
|
-
var __publicField$7 = (obj, key, value) =>
|
|
206
|
-
__defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
207
|
-
return value;
|
|
208
|
-
};
|
|
205
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
209
206
|
class BaseAdapter {
|
|
210
207
|
constructor(map, options) {
|
|
211
208
|
this.map = map;
|
|
@@ -287,10 +284,7 @@ var __spreadValues$7 = (a, b) => {
|
|
|
287
284
|
}
|
|
288
285
|
return a;
|
|
289
286
|
};
|
|
290
|
-
var __publicField$6 = (obj, key, value) =>
|
|
291
|
-
__defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
292
|
-
return value;
|
|
293
|
-
};
|
|
287
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
294
288
|
class GeoJsonEvents {
|
|
295
289
|
constructor(layer) {
|
|
296
290
|
__publicField$6(this, "layer");
|
|
@@ -385,10 +379,7 @@ var __objRest$2 = (source, exclude) => {
|
|
|
385
379
|
}
|
|
386
380
|
return target;
|
|
387
381
|
};
|
|
388
|
-
var __publicField$5 = (obj, key, value) =>
|
|
389
|
-
__defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
390
|
-
return value;
|
|
391
|
-
};
|
|
382
|
+
var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
|
|
392
383
|
class GeoJsonPaint {
|
|
393
384
|
constructor(layer) {
|
|
394
385
|
__publicField$5(this, "layer");
|
|
@@ -537,10 +528,7 @@ var __spreadValues$5 = (a, b) => {
|
|
|
537
528
|
return a;
|
|
538
529
|
};
|
|
539
530
|
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
540
|
-
var __publicField$4 = (obj, key, value) =>
|
|
541
|
-
__defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
542
|
-
return value;
|
|
543
|
-
};
|
|
531
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
544
532
|
var __async = (__this, __arguments, generator) => {
|
|
545
533
|
return new Promise((resolve, reject) => {
|
|
546
534
|
var fulfilled = (value) => {
|
|
@@ -1126,14 +1114,10 @@ function callAjax(src, headers) {
|
|
|
1126
1114
|
}
|
|
1127
1115
|
|
|
1128
1116
|
const imageQueue = new Queue({ concurrency: 6, delay: 200 });
|
|
1129
|
-
var imageQueue$1 = imageQueue;
|
|
1130
1117
|
|
|
1131
1118
|
var __defProp$6 = Object.defineProperty;
|
|
1132
1119
|
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1133
|
-
var __publicField$3 = (obj, key, value) =>
|
|
1134
|
-
__defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1135
|
-
return value;
|
|
1136
|
-
};
|
|
1120
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
|
|
1137
1121
|
class ImageOverlay extends ImageOverlay$1 {
|
|
1138
1122
|
constructor(imageUrl, bounds, options) {
|
|
1139
1123
|
super(imageUrl, bounds, options);
|
|
@@ -1151,7 +1135,7 @@ class ImageOverlay extends ImageOverlay$1 {
|
|
|
1151
1135
|
const img = this._image;
|
|
1152
1136
|
const src = img.src;
|
|
1153
1137
|
img.src = "";
|
|
1154
|
-
imageQueue
|
|
1138
|
+
imageQueue.add(() => {
|
|
1155
1139
|
const [promise, abortFunc] = callAjax(src, headers);
|
|
1156
1140
|
promise.then((imgUrl) => {
|
|
1157
1141
|
img.src = imgUrl;
|
|
@@ -1164,10 +1148,7 @@ class ImageOverlay extends ImageOverlay$1 {
|
|
|
1164
1148
|
|
|
1165
1149
|
var __defProp$5 = Object.defineProperty;
|
|
1166
1150
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1167
|
-
var __publicField$2 = (obj, key, value) =>
|
|
1168
|
-
__defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1169
|
-
return value;
|
|
1170
|
-
};
|
|
1151
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1171
1152
|
class ImageLayer extends Layer {
|
|
1172
1153
|
constructor(url, options) {
|
|
1173
1154
|
super(options);
|
|
@@ -1371,10 +1352,7 @@ var __spreadValues$4 = (a, b) => {
|
|
|
1371
1352
|
}
|
|
1372
1353
|
return a;
|
|
1373
1354
|
};
|
|
1374
|
-
var __publicField$1 = (obj, key, value) =>
|
|
1375
|
-
__defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1376
|
-
return value;
|
|
1377
|
-
};
|
|
1355
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1378
1356
|
class ImageAdapter extends BaseAdapter {
|
|
1379
1357
|
constructor() {
|
|
1380
1358
|
super(...arguments);
|
|
@@ -1401,7 +1379,7 @@ class ImageAdapter extends BaseAdapter {
|
|
|
1401
1379
|
}
|
|
1402
1380
|
}
|
|
1403
1381
|
}
|
|
1404
|
-
__publicField$1(ImageAdapter, "queue", imageQueue
|
|
1382
|
+
__publicField$1(ImageAdapter, "queue", imageQueue);
|
|
1405
1383
|
|
|
1406
1384
|
function debounce(cb, wait = 10) {
|
|
1407
1385
|
let timeoutId;
|
|
@@ -1670,10 +1648,7 @@ var __spreadValues = (a, b) => {
|
|
|
1670
1648
|
}
|
|
1671
1649
|
return a;
|
|
1672
1650
|
};
|
|
1673
|
-
var __publicField = (obj, key, value) =>
|
|
1674
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1675
|
-
return value;
|
|
1676
|
-
};
|
|
1651
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1677
1652
|
const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
1678
1653
|
constructor() {
|
|
1679
1654
|
__publicField(this, "options", { target: "map" });
|
|
@@ -1751,8 +1726,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
|
1751
1726
|
}
|
|
1752
1727
|
setView(lngLatOrOpt, zoom) {
|
|
1753
1728
|
const map = this.map;
|
|
1754
|
-
if (!map)
|
|
1755
|
-
return;
|
|
1729
|
+
if (!map) return;
|
|
1756
1730
|
if (Array.isArray(lngLatOrOpt)) {
|
|
1757
1731
|
const lngLat = lngLatOrOpt;
|
|
1758
1732
|
const [lng, lat] = lngLat;
|
|
@@ -1820,8 +1794,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
|
1820
1794
|
return (_a = this.map && this.map.getZoom()) != null ? _a : void 0;
|
|
1821
1795
|
}
|
|
1822
1796
|
getBounds() {
|
|
1823
|
-
if (!this.map)
|
|
1824
|
-
return void 0;
|
|
1797
|
+
if (!this.map) return void 0;
|
|
1825
1798
|
const b = this.map.getBounds();
|
|
1826
1799
|
const sw = b.getSouthWest();
|
|
1827
1800
|
const ne = b.getNorthEast();
|