@nextgis/ngw-map 2.4.1 → 2.5.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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 2.4.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.5.1; author: NextGIS */
2
2
  var domain;
3
3
 
4
4
  // This constructor is used to store event handlers. Instantiating this is
@@ -473,7 +473,7 @@ function unwrapListeners(arr) {
473
473
 
474
474
  var __defProp$N = Object.defineProperty;
475
475
  var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
476
- var __publicField$z = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
476
+ var __publicField$z = (obj, key, value) => __defNormalProp$N(obj, key + "" , value);
477
477
  class CancelError extends Error {
478
478
  constructor() {
479
479
  super();
@@ -484,7 +484,7 @@ class CancelError extends Error {
484
484
 
485
485
  var __defProp$M = Object.defineProperty;
486
486
  var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
487
- var __publicField$y = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
487
+ var __publicField$y = (obj, key, value) => __defNormalProp$M(obj, key + "" , value);
488
488
  class PromiseControl {
489
489
  constructor(options = {}) {
490
490
  this.options = options;
@@ -566,7 +566,7 @@ class PromiseControl {
566
566
 
567
567
  var __defProp$L = Object.defineProperty;
568
568
  var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
569
- var __publicField$x = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
569
+ var __publicField$x = (obj, key, value) => __defNormalProp$L(obj, key + "" , value);
570
570
  class TimeoutError extends Error {
571
571
  constructor() {
572
572
  super();
@@ -1111,7 +1111,7 @@ function objectRemoveEmpty(obj) {
1111
1111
  }
1112
1112
 
1113
1113
  function round(val, toFixed) {
1114
- const n = toFixed ? Number("1e+" + toFixed) : 1;
1114
+ const n = 1;
1115
1115
  return Math.round((val + Number.EPSILON) * n) / n;
1116
1116
  }
1117
1117
 
@@ -1253,6 +1253,62 @@ const _Cache = class _Cache {
1253
1253
  __publicField$v(_Cache, "instance", {});
1254
1254
  let Cache = _Cache;
1255
1255
 
1256
+ var pkg = {
1257
+ name: "@nextgis/ngw-connector",
1258
+ version: "2.5.1",
1259
+ _priority: 12,
1260
+ description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1261
+ main: "index.js",
1262
+ module: "lib/ngw-connector.esm-bundler.js",
1263
+ unpkg: "lib/ngw-connector.global.prod.js",
1264
+ jsdelivr: "lib/ngw-connector.global.prod.js",
1265
+ types: "lib/index.d.ts",
1266
+ dependencies: {
1267
+ "@nextgis/cache": "^2.5.0",
1268
+ "@nextgis/cancelable-promise": "^2.5.0",
1269
+ "@nextgis/utils": "^2.5.0",
1270
+ "@types/events": "^3.0.0",
1271
+ events: "*",
1272
+ "form-data": "^4.0.0"
1273
+ },
1274
+ devDependencies: {
1275
+ "@nextgis/build-tools": "^2.5.0"
1276
+ },
1277
+ scripts: {
1278
+ clean: "rimraf ./lib",
1279
+ dev: "node ../build-tools/lib/build.js",
1280
+ prod: "npm run dev -- --release",
1281
+ lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
1282
+ watch: "npm run dev -- --watch",
1283
+ "gen:types": "node ./scripts/generator"
1284
+ },
1285
+ buildOptions: {
1286
+ name: "NgwConnector",
1287
+ formats: [
1288
+ "esm-bundler",
1289
+ "esm-browser",
1290
+ "cjs",
1291
+ "global"
1292
+ ]
1293
+ },
1294
+ keywords: [
1295
+ "NextGIS",
1296
+ "MAP"
1297
+ ],
1298
+ author: "NextGIS",
1299
+ files: [
1300
+ "index.js",
1301
+ "lib"
1302
+ ],
1303
+ license: "MIT",
1304
+ homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
1305
+ repository: {
1306
+ type: "git",
1307
+ url: "git://github.com/nextgis/nextgis_frontend.git"
1308
+ },
1309
+ gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
1310
+ };
1311
+
1256
1312
  var __defProp$I = Object.defineProperty;
1257
1313
  var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1258
1314
  var __publicField$u = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1314,8 +1370,8 @@ function resourceToQuery(resource, prefix = "") {
1314
1370
  }
1315
1371
 
1316
1372
  var __defProp$G = Object.defineProperty;
1317
- var __defProps$d = Object.defineProperties;
1318
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
1373
+ var __defProps$f = Object.defineProperties;
1374
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
1319
1375
  var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
1320
1376
  var __hasOwnProp$u = Object.prototype.hasOwnProperty;
1321
1377
  var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
@@ -1331,7 +1387,7 @@ var __spreadValues$t = (a, b) => {
1331
1387
  }
1332
1388
  return a;
1333
1389
  };
1334
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
1390
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
1335
1391
  var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
1336
1392
  var __async$l = (__this, __arguments, generator) => {
1337
1393
  return new Promise((resolve, reject) => {
@@ -1376,7 +1432,7 @@ class ResourcesControl {
1376
1432
  getOne(resource, requestOptions) {
1377
1433
  const cache = this.cache;
1378
1434
  const forCache = {};
1379
- const opt = __spreadProps$d(__spreadValues$t({}, requestOptions), { cache: false });
1435
+ const opt = __spreadProps$f(__spreadValues$t({}, requestOptions), { cache: false });
1380
1436
  if (typeof resource === "string") {
1381
1437
  forCache.keyname = resource;
1382
1438
  } else if (typeof resource === "number") {
@@ -1711,7 +1767,7 @@ function apiRequest(opt) {
1711
1767
 
1712
1768
  var __defProp$E = Object.defineProperty;
1713
1769
  var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1714
- var __publicField$q = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
1770
+ var __publicField$q = (obj, key, value) => __defNormalProp$E(obj, key + "" , value);
1715
1771
  class NetworkError extends Error {
1716
1772
  constructor(url) {
1717
1773
  super();
@@ -1830,6 +1886,8 @@ class NgwConnector {
1830
1886
  __publicField$p(this, "user");
1831
1887
  __publicField$p(this, "resources");
1832
1888
  __publicField$p(this, "cache");
1889
+ __publicField$p(this, "withCredentials");
1890
+ __publicField$p(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
1833
1891
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
1834
1892
  __publicField$p(this, "activeRequests", []);
1835
1893
  __publicField$p(this, "requestTransform");
@@ -1838,11 +1896,15 @@ class NgwConnector {
1838
1896
  if (exist) {
1839
1897
  return exist;
1840
1898
  } else {
1841
- if (this.options.route) {
1842
- this.routeStr = this.options.route;
1899
+ const { route, requestTransform, withCredentials } = this.options;
1900
+ if (route) {
1901
+ this.routeStr = route;
1902
+ }
1903
+ if (requestTransform) {
1904
+ this.requestTransform = requestTransform;
1843
1905
  }
1844
- if (this.options.requestTransform) {
1845
- this.requestTransform = this.options.requestTransform;
1906
+ if (withCredentials !== void 0) {
1907
+ this.withCredentials = withCredentials;
1846
1908
  }
1847
1909
  this.resources = new ResourcesControl({
1848
1910
  connector: this,
@@ -1891,7 +1953,8 @@ class NgwConnector {
1891
1953
  const auth = this.options.auth;
1892
1954
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
1893
1955
  const makeQuery = () => {
1894
- return this.makeQuery(this.routeStr, {}, {}).then((route) => {
1956
+ const routeUrl = `${this.routeStr}?client=${this.client}`;
1957
+ return this.makeQuery(routeUrl.toString(), {}, {}).then((route) => {
1895
1958
  resolve(route);
1896
1959
  }).catch((er) => {
1897
1960
  reject(er);
@@ -2011,6 +2074,9 @@ class NgwConnector {
2011
2074
  */
2012
2075
  apiRequest(name, params_ = {}, requestOptions = {}) {
2013
2076
  var _a, _b;
2077
+ requestOptions = __spreadValues$s({
2078
+ withCredentials: this.withCredentials
2079
+ }, requestOptions);
2014
2080
  const { method, headers, withCredentials, responseType } = requestOptions;
2015
2081
  params_ = (_a = requestOptions.params) != null ? _a : params_;
2016
2082
  const params = objectRemoveEmpty(params_);
@@ -2375,8 +2441,8 @@ function propertiesFilter(properties, filters) {
2375
2441
  }
2376
2442
 
2377
2443
  var __defProp$B = Object.defineProperty;
2378
- var __defProps$c = Object.defineProperties;
2379
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
2444
+ var __defProps$e = Object.defineProperties;
2445
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
2380
2446
  var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
2381
2447
  var __hasOwnProp$r = Object.prototype.hasOwnProperty;
2382
2448
  var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
@@ -2392,7 +2458,7 @@ var __spreadValues$q = (a, b) => {
2392
2458
  }
2393
2459
  return a;
2394
2460
  };
2395
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
2461
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
2396
2462
  const FEATURE_REQUEST_PARAMS = {
2397
2463
  srs: 4326,
2398
2464
  geom_format: "geojson"
@@ -2413,7 +2479,7 @@ function updateItemRequestParam(params, options) {
2413
2479
  if (extensionsStr !== "*") {
2414
2480
  params.extensions = extensionsStr;
2415
2481
  }
2416
- if (fields !== void 0) {
2482
+ if (fields !== void 0 && fields !== null) {
2417
2483
  params.fields = Array.isArray(fields) ? fields.join(",") : "";
2418
2484
  }
2419
2485
  if (geom !== void 0) {
@@ -2478,13 +2544,13 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
2478
2544
  for (const f of filters_) {
2479
2545
  if (isPropertyFilter(f)) {
2480
2546
  _queries.push(
2481
- fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
2547
+ fetchNgwLayerItemsRequest(__spreadProps$e(__spreadValues$q({}, opt), {
2482
2548
  paramList: [..._parentAllParams, ...paramList, createParam(f)]
2483
2549
  }))
2484
2550
  );
2485
2551
  } else {
2486
2552
  getQueries(
2487
- __spreadProps$c(__spreadValues$q({}, opt), {
2553
+ __spreadProps$e(__spreadValues$q({}, opt), {
2488
2554
  filters: f
2489
2555
  }),
2490
2556
  _queries,
@@ -2505,7 +2571,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
2505
2571
  if (propertiesFilterList.length) {
2506
2572
  for (const x of propertiesFilterList) {
2507
2573
  getQueries(
2508
- __spreadProps$c(__spreadValues$q({}, opt), {
2574
+ __spreadProps$e(__spreadValues$q({}, opt), {
2509
2575
  filters: x
2510
2576
  }),
2511
2577
  _queries,
@@ -2514,7 +2580,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
2514
2580
  }
2515
2581
  } else {
2516
2582
  _queries.push(
2517
- fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
2583
+ fetchNgwLayerItemsRequest(__spreadProps$e(__spreadValues$q({}, opt), {
2518
2584
  paramList: [..._parentAllParams, ...paramList, ...filters2]
2519
2585
  }))
2520
2586
  );
@@ -2580,8 +2646,8 @@ function fetchNgwLayerItemsRequest(options) {
2580
2646
  }
2581
2647
 
2582
2648
  var __defProp$A = Object.defineProperty;
2583
- var __defProps$b = Object.defineProperties;
2584
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
2649
+ var __defProps$d = Object.defineProperties;
2650
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
2585
2651
  var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
2586
2652
  var __hasOwnProp$q = Object.prototype.hasOwnProperty;
2587
2653
  var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
@@ -2597,7 +2663,7 @@ var __spreadValues$p = (a, b) => {
2597
2663
  }
2598
2664
  return a;
2599
2665
  };
2600
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
2666
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
2601
2667
  function fetchNgwLayerItem(options) {
2602
2668
  const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
2603
2669
  updateItemRequestParam(params, options);
@@ -2607,18 +2673,18 @@ function fetchNgwLayerItem(options) {
2607
2673
  }, params);
2608
2674
  const cache = options.cache || true;
2609
2675
  return options.connector.get("feature_layer.feature.item", { cache }, queryParams).then((resp) => {
2610
- return __spreadProps$b(__spreadValues$p({}, resp), {
2676
+ return __spreadProps$d(__spreadValues$p({}, resp), {
2611
2677
  toGeojson: () => {
2612
2678
  if (resp.geom) {
2613
2679
  return CancelablePromise.resolve(createGeoJsonFeature(resp));
2614
2680
  } else {
2615
- return fetchNgwLayerItem(__spreadProps$b(__spreadValues$p({}, options), {
2681
+ return fetchNgwLayerItem(__spreadProps$d(__spreadValues$p({}, options), {
2616
2682
  geom: true,
2617
2683
  fields: null,
2618
2684
  extensions: null
2619
2685
  })).then((onlyGeomItem) => {
2620
2686
  const geom = onlyGeomItem.geom;
2621
- return createGeoJsonFeature(__spreadProps$b(__spreadValues$p({}, resp), { geom }));
2687
+ return createGeoJsonFeature(__spreadProps$d(__spreadValues$p({}, resp), { geom }));
2622
2688
  });
2623
2689
  }
2624
2690
  }
@@ -2680,22 +2746,20 @@ class BookmarkItem {
2680
2746
  }
2681
2747
 
2682
2748
  function treeEvery(item, filter, relation, itemPrepare) {
2683
- return !!treeWrapper(item, filter, relation, treeEvery_, itemPrepare);
2749
+ return !!treeWrapper(item, filter, relation, treeEvery_);
2684
2750
  }
2685
2751
  function treeSome(item, filter, relation, itemPrepare) {
2686
- return !!treeWrapper(item, filter, relation, treeFind_, itemPrepare);
2752
+ return !!treeWrapper(item, filter, relation, treeFind_);
2687
2753
  }
2688
2754
  function treeFind(item, filter, relation, itemPrepare) {
2689
- return treeWrapper(item, filter, relation, treeFind_, itemPrepare);
2755
+ return treeWrapper(item, filter, relation, treeFind_);
2690
2756
  }
2691
2757
  function treeFilter(item, filter, relation, itemPrepare) {
2692
2758
  return treeWrapper(
2693
2759
  item,
2694
2760
  filter,
2695
2761
  relation,
2696
- treeFilter_,
2697
- itemPrepare
2698
- );
2762
+ treeFilter_);
2699
2763
  }
2700
2764
  function getChildren(item, relation = "children") {
2701
2765
  let children = [];
@@ -2712,13 +2776,6 @@ function getChildren(item, relation = "children") {
2712
2776
  }
2713
2777
  function treeWrapper(item, filter = (x) => !!x, relation = "children", treeFunction, itemPrepare) {
2714
2778
  const filterFunction = typeof filter === "function" ? filter : (i) => propertiesFilter(i, filter);
2715
- if (itemPrepare) {
2716
- return treeFunction(
2717
- item,
2718
- (i) => filterFunction(itemPrepare(i)),
2719
- relation
2720
- );
2721
- }
2722
2779
  return treeFunction(item, filterFunction, relation);
2723
2780
  }
2724
2781
  function treeFind_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
@@ -2985,7 +3042,7 @@ var __spreadValues$o = (a, b) => {
2985
3042
  }
2986
3043
  return a;
2987
3044
  };
2988
- var __publicField$l = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
3045
+ var __publicField$l = (obj, key, value) => __defNormalProp$w(obj, key + "" , value);
2989
3046
  const _CheckProperty = class _CheckProperty extends BaseProperty {
2990
3047
  constructor(name, item, options) {
2991
3048
  super(name, item, __spreadValues$o(__spreadValues$o({}, _CheckProperty.options), options));
@@ -3272,8 +3329,8 @@ class WebmapLayerOpacityPropertyHandler extends BaseProperty {
3272
3329
  }
3273
3330
 
3274
3331
  var __defProp$t = Object.defineProperty;
3275
- var __defProps$a = Object.defineProperties;
3276
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
3332
+ var __defProps$c = Object.defineProperties;
3333
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
3277
3334
  var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
3278
3335
  var __hasOwnProp$m = Object.prototype.hasOwnProperty;
3279
3336
  var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
@@ -3289,7 +3346,7 @@ var __spreadValues$l = (a, b) => {
3289
3346
  }
3290
3347
  return a;
3291
3348
  };
3292
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
3349
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
3293
3350
  function getNgwWebmapExtent(webmap) {
3294
3351
  const bottom = webmap["extent_bottom"];
3295
3352
  const left = webmap["extent_left"];
@@ -3352,14 +3409,14 @@ function fetchNgwResourceExtent(item, connector, options) {
3352
3409
  if (resource.cls && resource.cls.indexOf("style") !== -1) {
3353
3410
  return connector.getResource(resource.parent.id).then((res) => {
3354
3411
  if (res) {
3355
- return fetchNgwLayerExtent(__spreadProps$a(__spreadValues$l({}, options), {
3412
+ return fetchNgwLayerExtent(__spreadProps$c(__spreadValues$l({}, options), {
3356
3413
  resourceId: res.resource.id,
3357
3414
  connector
3358
3415
  }));
3359
3416
  }
3360
3417
  });
3361
3418
  } else {
3362
- return fetchNgwLayerExtent(__spreadProps$a(__spreadValues$l({}, options), {
3419
+ return fetchNgwLayerExtent(__spreadProps$c(__spreadValues$l({}, options), {
3363
3420
  resourceId: resource.id,
3364
3421
  connector
3365
3422
  }));
@@ -3681,8 +3738,8 @@ __publicField$g(QmsKit, "utils", {
3681
3738
  });
3682
3739
 
3683
3740
  var __defProp$p = Object.defineProperty;
3684
- var __defProps$9 = Object.defineProperties;
3685
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
3741
+ var __defProps$b = Object.defineProperties;
3742
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
3686
3743
  var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
3687
3744
  var __getProtoOf$2 = Object.getPrototypeOf;
3688
3745
  var __hasOwnProp$j = Object.prototype.hasOwnProperty;
@@ -3700,7 +3757,7 @@ var __spreadValues$i = (a, b) => {
3700
3757
  }
3701
3758
  return a;
3702
3759
  };
3703
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
3760
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
3704
3761
  var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
3705
3762
  var __async$h = (__this, __arguments, generator) => {
3706
3763
  return new Promise((resolve, reject) => {
@@ -3745,7 +3802,7 @@ function createBasemapLayerAdapter(_0) {
3745
3802
  class BasemapTileAdapter extends TileAdapter {
3746
3803
  addLayer(opt) {
3747
3804
  return __async$h(this, null, function* () {
3748
- return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$9(__spreadValues$i({}, opt), { url }));
3805
+ return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$b(__spreadValues$i({}, opt), { url }));
3749
3806
  });
3750
3807
  }
3751
3808
  }
@@ -3824,8 +3881,8 @@ function prepareNgwFieldsToPropertiesFilter(fields) {
3824
3881
  }
3825
3882
 
3826
3883
  var __defProp$o = Object.defineProperty;
3827
- var __defProps$8 = Object.defineProperties;
3828
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
3884
+ var __defProps$a = Object.defineProperties;
3885
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
3829
3886
  var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
3830
3887
  var __hasOwnProp$i = Object.prototype.hasOwnProperty;
3831
3888
  var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
@@ -3841,18 +3898,18 @@ var __spreadValues$h = (a, b) => {
3841
3898
  }
3842
3899
  return a;
3843
3900
  };
3844
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
3901
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
3845
3902
  function fetchNgwLayerItems(options) {
3846
3903
  const filters = options.filters;
3847
3904
  if (filters) {
3848
- return createFeatureFieldFilterQueries(__spreadProps$8(__spreadValues$h({}, options), {
3905
+ return createFeatureFieldFilterQueries(__spreadProps$a(__spreadValues$h({}, options), {
3849
3906
  filters
3850
3907
  })).then((data) => {
3851
3908
  var _a;
3852
3909
  const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
3853
3910
  if (clientFilterValidate) {
3854
3911
  data = data.filter((y) => {
3855
- const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$8(__spreadValues$h({}, y.fields), {
3912
+ const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$a(__spreadValues$h({}, y.fields), {
3856
3913
  id: y.id
3857
3914
  }));
3858
3915
  const result = propertiesFilter(fields, filters);
@@ -3920,8 +3977,8 @@ function getLayerFilterOptions(options) {
3920
3977
  }
3921
3978
 
3922
3979
  var __defProp$n = Object.defineProperty;
3923
- var __defProps$7 = Object.defineProperties;
3924
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
3980
+ var __defProps$9 = Object.defineProperties;
3981
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
3925
3982
  var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
3926
3983
  var __getProtoOf$1 = Object.getPrototypeOf;
3927
3984
  var __hasOwnProp$h = Object.prototype.hasOwnProperty;
@@ -3939,7 +3996,7 @@ var __spreadValues$g = (a, b) => {
3939
3996
  }
3940
3997
  return a;
3941
3998
  };
3942
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
3999
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
3943
4000
  var __publicField$f = (obj, key, value) => __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
3944
4001
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
3945
4002
  var __async$g = (__this, __arguments, generator) => {
@@ -4112,7 +4169,7 @@ function createGeoJsonAdapter(props) {
4112
4169
  try {
4113
4170
  this.emitter.emit("preupdate", filterArgs);
4114
4171
  webMap._emitLayerEvent("layer:preupdate", options.id || "", filterArgs);
4115
- const data = yield getData(filterArgs.filters, __spreadProps$7(__spreadValues$g({}, filterArgs.options), {
4172
+ const data = yield getData(filterArgs.filters, __spreadProps$9(__spreadValues$g({}, filterArgs.options), {
4116
4173
  srs: this.options.srs
4117
4174
  }));
4118
4175
  let newData = data;
@@ -4165,7 +4222,7 @@ function createGeoJsonAdapter(props) {
4165
4222
  if (this.clearLayer) {
4166
4223
  this.clearLayer();
4167
4224
  }
4168
- const data = yield getData(filters, __spreadProps$7(__spreadValues$g({}, opt), {
4225
+ const data = yield getData(filters, __spreadProps$9(__spreadValues$g({}, opt), {
4169
4226
  srs: this.options.srs
4170
4227
  }));
4171
4228
  this.setData(data);
@@ -4355,8 +4412,8 @@ function ngwApiToAdapterOptions({
4355
4412
  }
4356
4413
 
4357
4414
  var __defProp$m = Object.defineProperty;
4358
- var __defProps$6 = Object.defineProperties;
4359
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
4415
+ var __defProps$8 = Object.defineProperties;
4416
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
4360
4417
  var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
4361
4418
  var __hasOwnProp$g = Object.prototype.hasOwnProperty;
4362
4419
  var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
@@ -4372,7 +4429,7 @@ var __spreadValues$f = (a, b) => {
4372
4429
  }
4373
4430
  return a;
4374
4431
  };
4375
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
4432
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
4376
4433
  var __publicField$e = (obj, key, value) => __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
4377
4434
  var __async$e = (__this, __arguments, generator) => {
4378
4435
  return new Promise((resolve, reject) => {
@@ -4436,7 +4493,7 @@ function createRasterAdapter(_0) {
4436
4493
  baseUrl: connector.options.baseUrl || ""
4437
4494
  });
4438
4495
  if (opt) {
4439
- const layerAdapterOptions = __spreadProps$6(__spreadValues$f(__spreadValues$f({}, opt), layerOptions.adapterOptions), {
4496
+ const layerAdapterOptions = __spreadProps$8(__spreadValues$f(__spreadValues$f({}, opt), layerOptions.adapterOptions), {
4440
4497
  params: { resource: resourceId },
4441
4498
  layers: opt.layers || String(resourceId),
4442
4499
  resourceId
@@ -4494,8 +4551,8 @@ function createRasterAdapter(_0) {
4494
4551
  }
4495
4552
 
4496
4553
  var __defProp$l = Object.defineProperty;
4497
- var __defProps$5 = Object.defineProperties;
4498
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
4554
+ var __defProps$7 = Object.defineProperties;
4555
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
4499
4556
  var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
4500
4557
  var __hasOwnProp$f = Object.prototype.hasOwnProperty;
4501
4558
  var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
@@ -4511,7 +4568,7 @@ var __spreadValues$e = (a, b) => {
4511
4568
  }
4512
4569
  return a;
4513
4570
  };
4514
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
4571
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
4515
4572
  var __async$d = (__this, __arguments, generator) => {
4516
4573
  return new Promise((resolve, reject) => {
4517
4574
  var fulfilled = (value) => {
@@ -4559,7 +4616,7 @@ function createAdapterFromFirstStyle(_0) {
4559
4616
  const firstStyle = childrenStyles && childrenStyles[0];
4560
4617
  if (firstStyle) {
4561
4618
  return createAsyncAdapter(
4562
- __spreadProps$5(__spreadValues$e({}, layerOptions), { resource: firstStyle.resource.id }),
4619
+ __spreadProps$7(__spreadValues$e({}, layerOptions), { resource: firstStyle.resource.id }),
4563
4620
  webMap,
4564
4621
  connector
4565
4622
  );
@@ -4582,13 +4639,13 @@ function createAsyncAdapter(options, webMap, connector) {
4582
4639
  }
4583
4640
  if (item) {
4584
4641
  const cls = item.resource.cls;
4585
- const layerOptions = __spreadProps$5(__spreadValues$e({}, options), {
4642
+ const layerOptions = __spreadProps$7(__spreadValues$e({}, options), {
4586
4643
  resource: resourceId
4587
4644
  });
4588
4645
  const adapterOptions = {
4589
4646
  layerOptions,
4590
- webMap,
4591
4647
  connector,
4648
+ webMap,
4592
4649
  item
4593
4650
  };
4594
4651
  if (supportCls.indexOf(cls) !== -1) {
@@ -4619,10 +4676,10 @@ function createAsyncAdapter(options, webMap, connector) {
4619
4676
  item.resource.parent.id
4620
4677
  );
4621
4678
  if (parentItem) {
4622
- const parentOptions = __spreadProps$5(__spreadValues$e({}, options), {
4679
+ const parentOptions = __spreadProps$7(__spreadValues$e({}, options), {
4623
4680
  resource: item.resource.parent.id
4624
4681
  });
4625
- adapter = createGeoJsonAdapter(__spreadProps$5(__spreadValues$e({}, adapterOptions), {
4682
+ adapter = createGeoJsonAdapter(__spreadProps$7(__spreadValues$e({}, adapterOptions), {
4626
4683
  item: parentItem,
4627
4684
  layerOptions: parentOptions
4628
4685
  }));
@@ -4711,6 +4768,9 @@ function createNgwLayerAdapter(options, webMap, connector) {
4711
4768
  if (headers) {
4712
4769
  options.headers = headers;
4713
4770
  }
4771
+ if (connector.withCredentials !== void 0) {
4772
+ options.withCredentials = connector.withCredentials;
4773
+ }
4714
4774
  return createAsyncAdapter(options, webMap, connector);
4715
4775
  }
4716
4776
  function extendNgwWebmapLayerAdapter(opt) {
@@ -4748,6 +4808,8 @@ function setScaleRatio(scale, lat = 0) {
4748
4808
  }
4749
4809
 
4750
4810
  var __defProp$j = Object.defineProperty;
4811
+ var __defProps$6 = Object.defineProperties;
4812
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
4751
4813
  var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
4752
4814
  var __hasOwnProp$d = Object.prototype.hasOwnProperty;
4753
4815
  var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
@@ -4763,6 +4825,7 @@ var __spreadValues$c = (a, b) => {
4763
4825
  }
4764
4826
  return a;
4765
4827
  };
4828
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
4766
4829
  var __publicField$d = (obj, key, value) => __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
4767
4830
  var __async$c = (__this, __arguments, generator) => {
4768
4831
  return new Promise((resolve, reject) => {
@@ -4869,14 +4932,12 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
4869
4932
  getItemOptions(item) {
4870
4933
  const transparency = item.item_type === "layer" && item.layer_transparency;
4871
4934
  const opacity = typeof transparency === "number" ? (100 - transparency) / 100 : void 0;
4872
- const options = {
4935
+ const options = __spreadProps$6(__spreadValues$c({
4873
4936
  visibility: false,
4874
- name: item.display_name,
4875
- headers: this.options.headers,
4876
- crossOrigin: this.options.crossOrigin,
4877
- setViewDelay: this.options.setViewDelay,
4937
+ name: item.display_name
4938
+ }, this.options), {
4878
4939
  params: { resource: this.item.resourceId, item: this.item }
4879
- };
4940
+ });
4880
4941
  if (this.options.order) {
4881
4942
  const subOrder = this.options.drawOrderEnabled && "draw_order_position" in item ? this._rootDescendantsCount - item.draw_order_position : this.id;
4882
4943
  const subLevel = String(subOrder).padStart(4, "0");
@@ -4887,17 +4948,16 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
4887
4948
  }
4888
4949
  if (item.item_type === "layer") {
4889
4950
  const { maxZoom, minZoom } = this._getZoomRange(item);
4890
- Object.assign(options, {
4891
- updateWmsParams: item.updateWmsParams,
4951
+ Object.assign(options, __spreadProps$6(__spreadValues$c({
4952
+ updateWmsParams: item.updateWmsParams
4953
+ }, this.options), {
4892
4954
  url: item.url,
4893
- headers: this.options.headers,
4894
- ratio: this.options.ratio,
4895
4955
  maxZoom,
4896
4956
  minZoom,
4897
4957
  minScale: item.layer_min_scale_denom,
4898
4958
  maxScale: item.layer_max_scale_denom,
4899
4959
  interactive: item.layer_identifiable
4900
- });
4960
+ }));
4901
4961
  }
4902
4962
  if (opacity !== void 0) {
4903
4963
  options.opacity = opacity;
@@ -5203,6 +5263,8 @@ function createOnFirstShowNgwAdapter(_0) {
5203
5263
  const WEBMAP_BASELAYER_ID_PREFIX = "webmap-baselayer";
5204
5264
 
5205
5265
  var __defProp$h = Object.defineProperty;
5266
+ var __defProps$5 = Object.defineProperties;
5267
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
5206
5268
  var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
5207
5269
  var __hasOwnProp$b = Object.prototype.hasOwnProperty;
5208
5270
  var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
@@ -5218,6 +5280,7 @@ var __spreadValues$a = (a, b) => {
5218
5280
  }
5219
5281
  return a;
5220
5282
  };
5283
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
5221
5284
  var __publicField$b = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
5222
5285
  var __async$9 = (__this, __arguments, generator) => {
5223
5286
  return new Promise((resolve, reject) => {
@@ -5416,35 +5479,32 @@ class NgwWebmapLayerAdapter {
5416
5479
  }
5417
5480
  _getWebMapLayerItem() {
5418
5481
  return __async$9(this, null, function* () {
5419
- if (this.resourceId) {
5420
- const webmap = yield this.getWebMapConfig(this.resourceId);
5421
- if (webmap && webmap.root_item) {
5422
- return new Promise((resolve) => {
5423
- const options = {};
5424
- if (this.options.connector && this.options.connector.options.auth) {
5425
- const headers = this.options.connector.getAuthorizationHeaders();
5426
- if (headers) {
5427
- options.headers = headers;
5428
- }
5429
- }
5430
- options.setViewDelay = this.options.setViewDelay;
5431
- options.order = this.options.order;
5432
- options.ratio = this.options.ratio;
5433
- options.crossOrigin = this.options.crossOrigin;
5434
- options.minZoom = this.options.minZoom;
5435
- options.maxZoom = this.options.maxZoom;
5436
- options.drawOrderEnabled = webmap.draw_order_enabled;
5437
- options.popupOptions = this.options.popupOptions;
5438
- const layer = new this.NgwWebmapItem(
5439
- this.options.webMap,
5440
- webmap.root_item,
5441
- options,
5442
- this.options.connector
5443
- );
5444
- layer.emitter.on("init", () => resolve(layer));
5445
- });
5446
- }
5482
+ if (!this.resourceId) {
5483
+ return void 0;
5447
5484
  }
5485
+ const webmap = yield this.getWebMapConfig(this.resourceId);
5486
+ if (!webmap || !webmap.root_item) {
5487
+ return void 0;
5488
+ }
5489
+ return new Promise((resolve) => {
5490
+ const connector = this.options.connector;
5491
+ const headers = (connector == null ? void 0 : connector.options.auth) ? connector.getAuthorizationHeaders() : void 0;
5492
+ const withCredentials = connector.withCredentials;
5493
+ const options = __spreadProps$5(__spreadValues$a({}, this.options), {
5494
+ withCredentials,
5495
+ headers,
5496
+ drawOrderEnabled: webmap.draw_order_enabled
5497
+ });
5498
+ const layer = new this.NgwWebmapItem(
5499
+ this.options.webMap,
5500
+ webmap.root_item,
5501
+ options,
5502
+ connector
5503
+ );
5504
+ layer.emitter.on("init", () => {
5505
+ resolve(layer);
5506
+ });
5507
+ });
5448
5508
  });
5449
5509
  }
5450
5510
  getWebMapConfig(id) {
@@ -9072,7 +9132,8 @@ function prepareWebMapOptions(options) {
9072
9132
  if (!options.connector) {
9073
9133
  options.connector = new NgwConnector({
9074
9134
  baseUrl: options.baseUrl || "",
9075
- auth: options.auth
9135
+ auth: options.auth,
9136
+ withCredentials: options.withCredentials
9076
9137
  });
9077
9138
  } else if (options.connector) {
9078
9139
  options.baseUrl = options.connector.options.baseUrl;