@nextgis/ngw-map 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-map; version: 2.5.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.5.3; author: NextGIS */
2
2
  var NgwMap = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1258,7 +1258,7 @@ var NgwMap = (function (exports) {
1258
1258
 
1259
1259
  var pkg = {
1260
1260
  name: "@nextgis/ngw-connector",
1261
- version: "2.5.1",
1261
+ version: "2.5.2",
1262
1262
  _priority: 12,
1263
1263
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1264
1264
  main: "index.js",
@@ -2030,9 +2030,9 @@ var NgwMap = (function (exports) {
2030
2030
  credentials = credentials || this.options.auth;
2031
2031
  if (credentials) {
2032
2032
  const { login, password } = credentials;
2033
- const str = unescape(encodeURIComponent(`${login}:${password}`));
2033
+ const encodedStr = [login, password].map(encodeURIComponent).join(":");
2034
2034
  {
2035
- return window.btoa(str);
2035
+ return window.btoa(encodedStr);
2036
2036
  }
2037
2037
  }
2038
2038
  }
@@ -5321,7 +5321,6 @@ var NgwMap = (function (exports) {
5321
5321
  __publicField$b(this, "emitter", new EventEmitter());
5322
5322
  __publicField$b(this, "_extent");
5323
5323
  __publicField$b(this, "response");
5324
- __publicField$b(this, "_webmapLayersIds");
5325
5324
  __publicField$b(this, "_webmapBaselayersIds", []);
5326
5325
  __publicField$b(this, "_lastActiveBaselayer");
5327
5326
  const r = options.resourceId;
@@ -5366,7 +5365,6 @@ var NgwMap = (function (exports) {
5366
5365
  }
5367
5366
  delete this.layer;
5368
5367
  delete this.response;
5369
- delete this._webmapLayersIds;
5370
5368
  }
5371
5369
  showLayer() {
5372
5370
  return __async$9(this, null, function* () {
@@ -5457,26 +5455,19 @@ var NgwMap = (function (exports) {
5457
5455
  getIdentificationIds() {
5458
5456
  return __async$9(this, null, function* () {
5459
5457
  const visibleLayers = [];
5460
- let ids = this._webmapLayersIds;
5461
- if (!ids) {
5462
- ids = yield this._getWebMapIds();
5463
- this._webmapLayersIds = ids;
5464
- }
5465
- if (ids && ids.length) {
5466
- let deps = this.getDependLayers();
5467
- deps = deps.sort((a, b) => b.id - a.id);
5468
- deps.forEach((x) => {
5469
- const item = x.item;
5470
- const parentId = item.parentId;
5471
- if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
5472
- const visible = x.properties.property("visibility");
5473
- const isVisible = visible.get() && !visible.isBlocked();
5474
- if (isVisible) {
5475
- visibleLayers.push(parentId);
5476
- }
5458
+ let deps = this.getDependLayers();
5459
+ deps = deps.sort((a, b) => b.id - a.id);
5460
+ deps.forEach((x) => {
5461
+ const item = x.item;
5462
+ const parentId = item.style_parent_id;
5463
+ if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
5464
+ const visible = x.properties.property("visibility");
5465
+ const isVisible = visible.get() && !visible.isBlocked();
5466
+ if (isVisible) {
5467
+ visibleLayers.push(parentId);
5477
5468
  }
5478
- });
5479
- }
5469
+ }
5470
+ });
5480
5471
  return visibleLayers;
5481
5472
  });
5482
5473
  }
@@ -5605,31 +5596,6 @@ var NgwMap = (function (exports) {
5605
5596
  }
5606
5597
  return item;
5607
5598
  }
5608
- _getWebMapIds() {
5609
- return __async$9(this, null, function* () {
5610
- const webMapItem = this.layer;
5611
- if (webMapItem && webMapItem.item.item_type === "root") {
5612
- const layers = webMapItem.tree.getDescendants();
5613
- const promises = [];
5614
- for (const x of layers) {
5615
- const item = x.item;
5616
- if (item.item_type === "layer") {
5617
- const id = item.layer_style_id;
5618
- const promise = this.options.connector.getResource(id).then((y) => {
5619
- if (y) {
5620
- const parentId = Number(y.resource.parent.id);
5621
- item.parentId = parentId;
5622
- return parentId;
5623
- }
5624
- });
5625
- promises.push(promise);
5626
- }
5627
- }
5628
- const ids = yield Promise.all(promises);
5629
- return ids.filter((x) => x !== void 0);
5630
- }
5631
- });
5632
- }
5633
5599
  }
5634
5600
 
5635
5601
  var __defProp$g = Object.defineProperty;
@@ -9398,7 +9364,7 @@ var NgwMap = (function (exports) {
9398
9364
  if (mem.layer.getDependLayers) {
9399
9365
  const dependLayers = mem.layer.getDependLayers();
9400
9366
  const dependFit = dependLayers.find((x) => {
9401
- return x.item && x.item.parentId === id;
9367
+ return x.item && x.item.style_parent_id === id;
9402
9368
  });
9403
9369
  if (dependFit) {
9404
9370
  return dependFit.layer;