@nextgis/ngw-map 4.0.0 → 4.0.1
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/README.md +2 -2
- package/lib/ngw-map.cjs.js +1 -1
- package/lib/ngw-map.esm-browser.js +16 -7
- package/lib/ngw-map.esm-browser.js.map +1 -1
- package/lib/ngw-map.esm-browser.prod.js +1 -1
- package/lib/ngw-map.esm-browser.prod.js.map +1 -1
- package/lib/ngw-map.esm-bundler.js +1 -1
- package/lib/ngw-map.global.js +16 -7
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NgwMap
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
Framework-independent NextGIS Web map class used by `ngw-leaflet`, `ngw-ol`,
|
|
6
6
|
and `ngw-maplibre-gl`.
|
|
@@ -21,7 +21,7 @@ npm install @nextgis/ngw-map @nextgis/leaflet-map-adapter leaflet
|
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
|
-
```
|
|
24
|
+
```javascript
|
|
25
25
|
import { NgwMap } from '@nextgis/ngw-map';
|
|
26
26
|
import MapAdapter from '@nextgis/leaflet-map-adapter';
|
|
27
27
|
import 'leaflet/dist/leaflet.css';
|
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 4.0.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 4.0.1; author: NextGIS */
|
|
2
2
|
const svgPath = {
|
|
3
3
|
brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
|
|
4
4
|
circle: '<circle cx="6" cy="6" r="6"/>',
|
|
@@ -1077,7 +1077,7 @@ function unwrapListeners(arr) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
1079
|
var pkg = {
|
|
1080
|
-
version: "4.0.
|
|
1080
|
+
version: "4.0.1"};
|
|
1081
1081
|
|
|
1082
1082
|
class AbortError extends Error {
|
|
1083
1083
|
constructor(message = "AbortError") {
|
|
@@ -4879,7 +4879,7 @@ class NgwWebmapLayerAdapter {
|
|
|
4879
4879
|
return webmap.bookmark_resource.id;
|
|
4880
4880
|
}
|
|
4881
4881
|
}
|
|
4882
|
-
fetchBookmarks(options) {
|
|
4882
|
+
fetchBookmarks(options = {}) {
|
|
4883
4883
|
const bookmarkResId = this.getBookmarksResourceId();
|
|
4884
4884
|
const connector = this.options.connector;
|
|
4885
4885
|
if (bookmarkResId) {
|
|
@@ -5540,9 +5540,9 @@ function createBasemapLayerAdapter(_0) {
|
|
|
5540
5540
|
item
|
|
5541
5541
|
}) {
|
|
5542
5542
|
if (item.basemap_layer) {
|
|
5543
|
-
const
|
|
5544
|
-
const url =
|
|
5545
|
-
if (qms) {
|
|
5543
|
+
const basemap = item.basemap_layer;
|
|
5544
|
+
const { qms, url } = basemap;
|
|
5545
|
+
if (qms && typeof qms === "string") {
|
|
5546
5546
|
const qms_ = JSON.parse(qms);
|
|
5547
5547
|
const adapter = Promise.resolve(
|
|
5548
5548
|
createQmsAdapter(webMap, {
|
|
@@ -5555,10 +5555,19 @@ function createBasemapLayerAdapter(_0) {
|
|
|
5555
5555
|
const TileAdapter = webMap.mapAdapter.layerAdapters.TILE;
|
|
5556
5556
|
if (TileAdapter) {
|
|
5557
5557
|
class BasemapTileAdapter extends TileAdapter {
|
|
5558
|
+
constructor(map, options) {
|
|
5559
|
+
super(map, __spreadProps$a(__spreadValues$f({}, options), { baselayer: true, order: 0 }));
|
|
5560
|
+
}
|
|
5558
5561
|
addLayer(opt) {
|
|
5559
5562
|
return __async$g(this, null, function* () {
|
|
5563
|
+
var _a, _b, _c;
|
|
5560
5564
|
if (url) {
|
|
5561
|
-
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$a(__spreadValues$f({}, opt), {
|
|
5565
|
+
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$a(__spreadValues$f({}, opt), {
|
|
5566
|
+
url,
|
|
5567
|
+
minZoom: (_a = basemap.z_min) != null ? _a : opt.minZoom,
|
|
5568
|
+
maxZoom: (_b = basemap.z_max) != null ? _b : opt.maxZoom,
|
|
5569
|
+
attribution: (_c = basemap.copyright_text) != null ? _c : opt.attribution
|
|
5570
|
+
}));
|
|
5562
5571
|
}
|
|
5563
5572
|
});
|
|
5564
5573
|
}
|