@nextgis/ngw-leaflet 2.5.1 → 2.5.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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.5.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.5.3; author: NextGIS */
2
2
  import 'leaflet/dist/leaflet.css';
3
3
  import LeafletMapAdapter from '@nextgis/leaflet-map-adapter';
4
4
  import { NgwMap } from '@nextgis/ngw-map';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.5.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.5.3; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -18379,7 +18379,7 @@ var NgwLeaflet = (function () {
18379
18379
 
18380
18380
  var pkg = {
18381
18381
  name: "@nextgis/ngw-connector",
18382
- version: "2.5.1",
18382
+ version: "2.5.2",
18383
18383
  _priority: 12,
18384
18384
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18385
18385
  main: "index.js",
@@ -19151,9 +19151,9 @@ var NgwLeaflet = (function () {
19151
19151
  credentials = credentials || this.options.auth;
19152
19152
  if (credentials) {
19153
19153
  const { login, password } = credentials;
19154
- const str = unescape(encodeURIComponent(`${login}:${password}`));
19154
+ const encodedStr = [login, password].map(encodeURIComponent).join(":");
19155
19155
  {
19156
- return window.btoa(str);
19156
+ return window.btoa(encodedStr);
19157
19157
  }
19158
19158
  }
19159
19159
  }
@@ -22348,7 +22348,6 @@ var NgwLeaflet = (function () {
22348
22348
  __publicField$b(this, "emitter", new EventEmitter());
22349
22349
  __publicField$b(this, "_extent");
22350
22350
  __publicField$b(this, "response");
22351
- __publicField$b(this, "_webmapLayersIds");
22352
22351
  __publicField$b(this, "_webmapBaselayersIds", []);
22353
22352
  __publicField$b(this, "_lastActiveBaselayer");
22354
22353
  const r = options.resourceId;
@@ -22393,7 +22392,6 @@ var NgwLeaflet = (function () {
22393
22392
  }
22394
22393
  delete this.layer;
22395
22394
  delete this.response;
22396
- delete this._webmapLayersIds;
22397
22395
  }
22398
22396
  showLayer() {
22399
22397
  return __async$8(this, null, function* () {
@@ -22484,26 +22482,19 @@ var NgwLeaflet = (function () {
22484
22482
  getIdentificationIds() {
22485
22483
  return __async$8(this, null, function* () {
22486
22484
  const visibleLayers = [];
22487
- let ids = this._webmapLayersIds;
22488
- if (!ids) {
22489
- ids = yield this._getWebMapIds();
22490
- this._webmapLayersIds = ids;
22491
- }
22492
- if (ids && ids.length) {
22493
- let deps = this.getDependLayers();
22494
- deps = deps.sort((a, b) => b.id - a.id);
22495
- deps.forEach((x) => {
22496
- const item = x.item;
22497
- const parentId = item.parentId;
22498
- if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
22499
- const visible = x.properties.property("visibility");
22500
- const isVisible = visible.get() && !visible.isBlocked();
22501
- if (isVisible) {
22502
- visibleLayers.push(parentId);
22503
- }
22485
+ let deps = this.getDependLayers();
22486
+ deps = deps.sort((a, b) => b.id - a.id);
22487
+ deps.forEach((x) => {
22488
+ const item = x.item;
22489
+ const parentId = item.style_parent_id;
22490
+ if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
22491
+ const visible = x.properties.property("visibility");
22492
+ const isVisible = visible.get() && !visible.isBlocked();
22493
+ if (isVisible) {
22494
+ visibleLayers.push(parentId);
22504
22495
  }
22505
- });
22506
- }
22496
+ }
22497
+ });
22507
22498
  return visibleLayers;
22508
22499
  });
22509
22500
  }
@@ -22632,31 +22623,6 @@ var NgwLeaflet = (function () {
22632
22623
  }
22633
22624
  return item;
22634
22625
  }
22635
- _getWebMapIds() {
22636
- return __async$8(this, null, function* () {
22637
- const webMapItem = this.layer;
22638
- if (webMapItem && webMapItem.item.item_type === "root") {
22639
- const layers = webMapItem.tree.getDescendants();
22640
- const promises = [];
22641
- for (const x of layers) {
22642
- const item = x.item;
22643
- if (item.item_type === "layer") {
22644
- const id = item.layer_style_id;
22645
- const promise = this.options.connector.getResource(id).then((y) => {
22646
- if (y) {
22647
- const parentId = Number(y.resource.parent.id);
22648
- item.parentId = parentId;
22649
- return parentId;
22650
- }
22651
- });
22652
- promises.push(promise);
22653
- }
22654
- }
22655
- const ids = yield Promise.all(promises);
22656
- return ids.filter((x) => x !== void 0);
22657
- }
22658
- });
22659
- }
22660
22626
  }
22661
22627
 
22662
22628
  var __defProp$e = Object.defineProperty;
@@ -25534,7 +25500,7 @@ var NgwLeaflet = (function () {
25534
25500
  if (mem.layer.getDependLayers) {
25535
25501
  const dependLayers = mem.layer.getDependLayers();
25536
25502
  const dependFit = dependLayers.find((x) => {
25537
- return x.item && x.item.parentId === id;
25503
+ return x.item && x.item.style_parent_id === id;
25538
25504
  });
25539
25505
  if (dependFit) {
25540
25506
  return dependFit.layer;