@nextgis/ngw-map 3.0.0-alpha.17 → 3.0.0-alpha.19
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/ngw-map.cjs.js +3 -2
- package/lib/ngw-map.cjs.js.map +1 -1
- package/lib/ngw-map.cjs.prod.js +1 -1
- package/lib/ngw-map.cjs.prod.js.map +1 -1
- package/lib/ngw-map.esm-browser.js +648 -539
- 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 +3 -2
- package/lib/ngw-map.esm-bundler.js.map +1 -1
- package/lib/ngw-map.esm-bundler.prod.js +1 -1
- package/lib/ngw-map.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-map.global.js +648 -539
- 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 +6 -6
package/lib/ngw-map.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.18; author: NextGIS */
|
|
2
2
|
var NgwMap = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -368,23 +368,23 @@ var NgwMap = (function (exports) {
|
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
var __defProp$
|
|
372
|
-
var __getOwnPropSymbols$
|
|
373
|
-
var __hasOwnProp$
|
|
374
|
-
var __propIsEnum$
|
|
375
|
-
var __defNormalProp$
|
|
376
|
-
var __spreadValues$
|
|
371
|
+
var __defProp$R = Object.defineProperty;
|
|
372
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
373
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
374
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
375
|
+
var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
376
|
+
var __spreadValues$y = (a, b) => {
|
|
377
377
|
for (var prop in b || (b = {}))
|
|
378
|
-
if (__hasOwnProp$
|
|
379
|
-
__defNormalProp$
|
|
380
|
-
if (__getOwnPropSymbols$
|
|
381
|
-
for (var prop of __getOwnPropSymbols$
|
|
382
|
-
if (__propIsEnum$
|
|
383
|
-
__defNormalProp$
|
|
378
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
379
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
380
|
+
if (__getOwnPropSymbols$z)
|
|
381
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
382
|
+
if (__propIsEnum$z.call(b, prop))
|
|
383
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
384
384
|
}
|
|
385
385
|
return a;
|
|
386
386
|
};
|
|
387
|
-
var __async$
|
|
387
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
388
388
|
return new Promise((resolve, reject) => {
|
|
389
389
|
var fulfilled = (value) => {
|
|
390
390
|
try {
|
|
@@ -405,7 +405,7 @@ var NgwMap = (function (exports) {
|
|
|
405
405
|
});
|
|
406
406
|
};
|
|
407
407
|
function apiRequest(opt) {
|
|
408
|
-
return __async$
|
|
408
|
+
return __async$w(this, null, function* () {
|
|
409
409
|
const { params, name, connector, requestOptions } = opt;
|
|
410
410
|
const apiItems = yield connector.connect();
|
|
411
411
|
let apiItem = apiItems && apiItems[name];
|
|
@@ -443,7 +443,7 @@ var NgwMap = (function (exports) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
if (url) {
|
|
446
|
-
return connector.makeQuery(url, params, __spreadValues$
|
|
446
|
+
return connector.makeQuery(url, params, __spreadValues$y({
|
|
447
447
|
cacheName: name
|
|
448
448
|
}, requestOptions));
|
|
449
449
|
} else {
|
|
@@ -455,12 +455,12 @@ var NgwMap = (function (exports) {
|
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
var __defProp$
|
|
459
|
-
var __defNormalProp$
|
|
460
|
-
var __publicField$
|
|
458
|
+
var __defProp$Q = Object.defineProperty;
|
|
459
|
+
var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
460
|
+
var __publicField$A = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
461
461
|
const _Cache = class _Cache {
|
|
462
462
|
constructor(options = {}) {
|
|
463
|
-
__publicField$
|
|
463
|
+
__publicField$A(this, "cache", []);
|
|
464
464
|
var _a;
|
|
465
465
|
const namespace = (_a = options.namespace) != null ? _a : "default";
|
|
466
466
|
if (_Cache.instance[namespace]) {
|
|
@@ -591,7 +591,7 @@ var NgwMap = (function (exports) {
|
|
|
591
591
|
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
|
-
__publicField$
|
|
594
|
+
__publicField$A(_Cache, "instance", {});
|
|
595
595
|
let Cache = _Cache;
|
|
596
596
|
|
|
597
597
|
var domain;
|
|
@@ -1068,7 +1068,7 @@ var NgwMap = (function (exports) {
|
|
|
1068
1068
|
|
|
1069
1069
|
var pkg = {
|
|
1070
1070
|
name: "@nextgis/ngw-connector",
|
|
1071
|
-
version: "3.0.0-alpha.
|
|
1071
|
+
version: "3.0.0-alpha.18",
|
|
1072
1072
|
_priority: 12,
|
|
1073
1073
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
1074
1074
|
main: "index.js",
|
|
@@ -1077,15 +1077,15 @@ var NgwMap = (function (exports) {
|
|
|
1077
1077
|
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
1078
1078
|
types: "lib/index.d.ts",
|
|
1079
1079
|
dependencies: {
|
|
1080
|
-
"@nextgis/cache": "^3.0.0-alpha.
|
|
1081
|
-
"@nextgis/cancelable-promise": "^3.0.0-alpha.
|
|
1082
|
-
"@nextgis/utils": "^3.0.0-alpha.
|
|
1080
|
+
"@nextgis/cache": "^3.0.0-alpha.17",
|
|
1081
|
+
"@nextgis/cancelable-promise": "^3.0.0-alpha.17",
|
|
1082
|
+
"@nextgis/utils": "^3.0.0-alpha.17",
|
|
1083
1083
|
"@types/events": "^3.0.0",
|
|
1084
1084
|
events: "*",
|
|
1085
1085
|
"form-data": "^4.0.0"
|
|
1086
1086
|
},
|
|
1087
1087
|
devDependencies: {
|
|
1088
|
-
"@nextgis/build-tools": "^3.0.0-alpha.
|
|
1088
|
+
"@nextgis/build-tools": "^3.0.0-alpha.17"
|
|
1089
1089
|
},
|
|
1090
1090
|
scripts: {
|
|
1091
1091
|
clean: "rimraf ./lib",
|
|
@@ -1132,46 +1132,46 @@ var NgwMap = (function (exports) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
|
-
var __defProp$
|
|
1136
|
-
var __defNormalProp$
|
|
1137
|
-
var __publicField$
|
|
1135
|
+
var __defProp$P = Object.defineProperty;
|
|
1136
|
+
var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1137
|
+
var __publicField$z = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1138
1138
|
class NgwError extends Error {
|
|
1139
1139
|
constructor(er) {
|
|
1140
1140
|
super();
|
|
1141
|
-
__publicField$
|
|
1142
|
-
__publicField$
|
|
1143
|
-
__publicField$
|
|
1144
|
-
__publicField$
|
|
1145
|
-
__publicField$
|
|
1146
|
-
__publicField$
|
|
1147
|
-
__publicField$
|
|
1148
|
-
__publicField$
|
|
1141
|
+
__publicField$z(this, "name", "NgwError");
|
|
1142
|
+
__publicField$z(this, "title");
|
|
1143
|
+
__publicField$z(this, "message");
|
|
1144
|
+
__publicField$z(this, "detail");
|
|
1145
|
+
__publicField$z(this, "exception");
|
|
1146
|
+
__publicField$z(this, "status_code");
|
|
1147
|
+
__publicField$z(this, "data");
|
|
1148
|
+
__publicField$z(this, "guru_meditation");
|
|
1149
1149
|
Object.assign(this, er);
|
|
1150
1150
|
Object.setPrototypeOf(this, NgwError.prototype);
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
1154
|
-
var __defProp$
|
|
1155
|
-
var __defNormalProp$
|
|
1156
|
-
var __publicField$
|
|
1154
|
+
var __defProp$O = Object.defineProperty;
|
|
1155
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1156
|
+
var __publicField$y = (obj, key, value) => __defNormalProp$O(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1157
1157
|
class InsufficientPermissionsError extends NgwError {
|
|
1158
1158
|
constructor(obj) {
|
|
1159
1159
|
super(obj);
|
|
1160
|
-
__publicField$
|
|
1161
|
-
__publicField$
|
|
1160
|
+
__publicField$y(this, "name", "InsufficientPermissionsError");
|
|
1161
|
+
__publicField$y(this, "exception", "nextgisweb.core.exception.InsufficientPermissions");
|
|
1162
1162
|
Object.setPrototypeOf(this, InsufficientPermissionsError.prototype);
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
-
var __defProp$
|
|
1167
|
-
var __defNormalProp$
|
|
1168
|
-
var __publicField$
|
|
1166
|
+
var __defProp$N = Object.defineProperty;
|
|
1167
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1168
|
+
var __publicField$x = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1169
1169
|
let NetworksResponseError$1 = class NetworksResponseError extends NgwError {
|
|
1170
1170
|
constructor(obj) {
|
|
1171
1171
|
super(obj);
|
|
1172
|
-
__publicField$
|
|
1173
|
-
__publicField$
|
|
1174
|
-
__publicField$
|
|
1172
|
+
__publicField$x(this, "message", "There is no response from the server or problem connecting to server.");
|
|
1173
|
+
__publicField$x(this, "title", "Network error");
|
|
1174
|
+
__publicField$x(this, "detail", "Check network connectivity and try again later.");
|
|
1175
1175
|
Object.setPrototypeOf(this, NetworksResponseError.prototype);
|
|
1176
1176
|
}
|
|
1177
1177
|
};
|
|
@@ -1208,27 +1208,27 @@ var NgwMap = (function (exports) {
|
|
|
1208
1208
|
return false;
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
-
var __defProp$
|
|
1212
|
-
var __defNormalProp$
|
|
1213
|
-
var __publicField$
|
|
1211
|
+
var __defProp$M = Object.defineProperty;
|
|
1212
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1213
|
+
var __publicField$w = (obj, key, value) => __defNormalProp$M(obj, key + "" , value);
|
|
1214
1214
|
class NetworkError extends Error {
|
|
1215
1215
|
constructor(url) {
|
|
1216
1216
|
super();
|
|
1217
|
-
__publicField$
|
|
1217
|
+
__publicField$w(this, "name", "NetworkError");
|
|
1218
1218
|
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
1219
1219
|
this.message = `Unable to request ${url}.
|
|
1220
1220
|
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
|
-
var __defProp$
|
|
1225
|
-
var __defNormalProp$
|
|
1226
|
-
var __publicField$
|
|
1224
|
+
var __defProp$L = Object.defineProperty;
|
|
1225
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1226
|
+
var __publicField$v = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1227
1227
|
class ResourceNotFoundError extends NgwError {
|
|
1228
1228
|
constructor(obj) {
|
|
1229
1229
|
super(obj);
|
|
1230
|
-
__publicField$
|
|
1231
|
-
__publicField$
|
|
1230
|
+
__publicField$v(this, "name", "ResourceNotFoundError");
|
|
1231
|
+
__publicField$v(this, "exception", "nextgisweb.resource.exception.ResourceNotFound");
|
|
1232
1232
|
Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
@@ -1245,13 +1245,13 @@ var NgwMap = (function (exports) {
|
|
|
1245
1245
|
isError: isError
|
|
1246
1246
|
});
|
|
1247
1247
|
|
|
1248
|
-
var __defProp$
|
|
1249
|
-
var __defNormalProp$
|
|
1250
|
-
var __publicField$
|
|
1248
|
+
var __defProp$K = Object.defineProperty;
|
|
1249
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1250
|
+
var __publicField$u = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1251
1251
|
class BaseAPIError extends Error {
|
|
1252
1252
|
constructor(message) {
|
|
1253
1253
|
super(message || "Something went wrong.");
|
|
1254
|
-
__publicField$
|
|
1254
|
+
__publicField$u(this, "title");
|
|
1255
1255
|
this.name = "BaseAPIError";
|
|
1256
1256
|
this.title = "Unknown API error";
|
|
1257
1257
|
if (Error.captureStackTrace) {
|
|
@@ -1263,7 +1263,7 @@ var NgwMap = (function (exports) {
|
|
|
1263
1263
|
// prettier-ignore
|
|
1264
1264
|
constructor(message) {
|
|
1265
1265
|
super(message || "There is no response from the server or problem connecting to server.");
|
|
1266
|
-
__publicField$
|
|
1266
|
+
__publicField$u(this, "detail");
|
|
1267
1267
|
this.title = "Network error";
|
|
1268
1268
|
this.detail = "Check network connectivity and try again later.";
|
|
1269
1269
|
}
|
|
@@ -1277,8 +1277,8 @@ var NgwMap = (function (exports) {
|
|
|
1277
1277
|
class ServerResponseError extends BaseAPIError {
|
|
1278
1278
|
constructor(data) {
|
|
1279
1279
|
super(data.message);
|
|
1280
|
-
__publicField$
|
|
1281
|
-
__publicField$
|
|
1280
|
+
__publicField$u(this, "detail");
|
|
1281
|
+
__publicField$u(this, "data");
|
|
1282
1282
|
this.title = data.title || this.title;
|
|
1283
1283
|
this.detail = data.detail || null;
|
|
1284
1284
|
this.data = data;
|
|
@@ -1288,8 +1288,8 @@ var NgwMap = (function (exports) {
|
|
|
1288
1288
|
// prettier-ignore
|
|
1289
1289
|
constructor(message, data = {}) {
|
|
1290
1290
|
super(message || "Unexpected error while processing long-running request.");
|
|
1291
|
-
__publicField$
|
|
1292
|
-
__publicField$
|
|
1291
|
+
__publicField$u(this, "title");
|
|
1292
|
+
__publicField$u(this, "data");
|
|
1293
1293
|
this.name = "LunkwillError";
|
|
1294
1294
|
this.title = "Long-running request error";
|
|
1295
1295
|
this.data = data;
|
|
@@ -1309,35 +1309,35 @@ var NgwMap = (function (exports) {
|
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
1311
|
|
|
1312
|
-
var __defProp$
|
|
1313
|
-
var __getOwnPropSymbols$
|
|
1314
|
-
var __hasOwnProp$
|
|
1315
|
-
var __propIsEnum$
|
|
1316
|
-
var __defNormalProp$
|
|
1317
|
-
var __spreadValues$
|
|
1312
|
+
var __defProp$J = Object.defineProperty;
|
|
1313
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
1314
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
1315
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
1316
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1317
|
+
var __spreadValues$x = (a, b) => {
|
|
1318
1318
|
for (var prop in b || (b = {}))
|
|
1319
|
-
if (__hasOwnProp$
|
|
1320
|
-
__defNormalProp$
|
|
1321
|
-
if (__getOwnPropSymbols$
|
|
1322
|
-
for (var prop of __getOwnPropSymbols$
|
|
1323
|
-
if (__propIsEnum$
|
|
1324
|
-
__defNormalProp$
|
|
1319
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
1320
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
1321
|
+
if (__getOwnPropSymbols$y)
|
|
1322
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
1323
|
+
if (__propIsEnum$y.call(b, prop))
|
|
1324
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
1325
1325
|
}
|
|
1326
1326
|
return a;
|
|
1327
1327
|
};
|
|
1328
1328
|
var __objRest$5 = (source, exclude) => {
|
|
1329
1329
|
var target = {};
|
|
1330
1330
|
for (var prop in source)
|
|
1331
|
-
if (__hasOwnProp$
|
|
1331
|
+
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1332
1332
|
target[prop] = source[prop];
|
|
1333
|
-
if (source != null && __getOwnPropSymbols$
|
|
1334
|
-
for (var prop of __getOwnPropSymbols$
|
|
1335
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1333
|
+
if (source != null && __getOwnPropSymbols$y)
|
|
1334
|
+
for (var prop of __getOwnPropSymbols$y(source)) {
|
|
1335
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
|
|
1336
1336
|
target[prop] = source[prop];
|
|
1337
1337
|
}
|
|
1338
1338
|
return target;
|
|
1339
1339
|
};
|
|
1340
|
-
var __async$
|
|
1340
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
1341
1341
|
return new Promise((resolve, reject) => {
|
|
1342
1342
|
var fulfilled = (value) => {
|
|
1343
1343
|
try {
|
|
@@ -1362,7 +1362,7 @@ var NgwMap = (function (exports) {
|
|
|
1362
1362
|
return ct !== void 0 && ct !== null && ct.includes("application/vnd.lunkwill.request-summary+json");
|
|
1363
1363
|
}
|
|
1364
1364
|
function responseJson(response) {
|
|
1365
|
-
return __async$
|
|
1365
|
+
return __async$v(this, null, function* () {
|
|
1366
1366
|
try {
|
|
1367
1367
|
return response.json();
|
|
1368
1368
|
} catch (e) {
|
|
@@ -1371,7 +1371,7 @@ var NgwMap = (function (exports) {
|
|
|
1371
1371
|
});
|
|
1372
1372
|
}
|
|
1373
1373
|
function lunkwillResponseUrl(lwResp) {
|
|
1374
|
-
return __async$
|
|
1374
|
+
return __async$v(this, null, function* () {
|
|
1375
1375
|
const lwData = yield responseJson(lwResp);
|
|
1376
1376
|
let delay = lwData.delay_ms;
|
|
1377
1377
|
const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
|
|
@@ -1415,7 +1415,7 @@ var NgwMap = (function (exports) {
|
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
1417
|
function lunkwillFetch(lwRespUrl) {
|
|
1418
|
-
return __async$
|
|
1418
|
+
return __async$v(this, null, function* () {
|
|
1419
1419
|
try {
|
|
1420
1420
|
return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
|
|
1421
1421
|
} catch (e) {
|
|
@@ -1463,14 +1463,14 @@ var NgwMap = (function (exports) {
|
|
|
1463
1463
|
return path + urlParams;
|
|
1464
1464
|
}
|
|
1465
1465
|
function request(path, options, cacheEngine) {
|
|
1466
|
-
return __async$
|
|
1466
|
+
return __async$v(this, null, function* () {
|
|
1467
1467
|
var _b, _c;
|
|
1468
1468
|
const defaults = {
|
|
1469
1469
|
method: "GET",
|
|
1470
1470
|
credentials: "same-origin",
|
|
1471
1471
|
headers: {}
|
|
1472
1472
|
};
|
|
1473
|
-
const _a = __spreadValues$
|
|
1473
|
+
const _a = __spreadValues$x(__spreadValues$x({}, defaults), options), {
|
|
1474
1474
|
withCredentials,
|
|
1475
1475
|
responseType,
|
|
1476
1476
|
cacheProps,
|
|
@@ -1507,7 +1507,7 @@ var NgwMap = (function (exports) {
|
|
|
1507
1507
|
opt.headers = headers;
|
|
1508
1508
|
}
|
|
1509
1509
|
const url = generateUrl(path, query);
|
|
1510
|
-
const makeRequest = () => __async$
|
|
1510
|
+
const makeRequest = () => __async$v(this, null, function* () {
|
|
1511
1511
|
let response;
|
|
1512
1512
|
try {
|
|
1513
1513
|
response = yield fetch(url, opt);
|
|
@@ -1550,7 +1550,7 @@ var NgwMap = (function (exports) {
|
|
|
1550
1550
|
if (cacheEngine) {
|
|
1551
1551
|
if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
|
|
1552
1552
|
if (cache !== false) {
|
|
1553
|
-
const props = cacheProps ? cacheProps : __spreadValues$
|
|
1553
|
+
const props = cacheProps ? cacheProps : __spreadValues$x({}, objectRemoveEmpty({
|
|
1554
1554
|
withCredentials,
|
|
1555
1555
|
responseType
|
|
1556
1556
|
}));
|
|
@@ -1570,38 +1570,38 @@ var NgwMap = (function (exports) {
|
|
|
1570
1570
|
});
|
|
1571
1571
|
}
|
|
1572
1572
|
|
|
1573
|
-
var __defProp$
|
|
1574
|
-
var __defProps$
|
|
1575
|
-
var __getOwnPropDescs$
|
|
1576
|
-
var __getOwnPropSymbols$
|
|
1577
|
-
var __hasOwnProp$
|
|
1578
|
-
var __propIsEnum$
|
|
1579
|
-
var __defNormalProp$
|
|
1580
|
-
var __spreadValues$
|
|
1573
|
+
var __defProp$I = Object.defineProperty;
|
|
1574
|
+
var __defProps$j = Object.defineProperties;
|
|
1575
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
1576
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
1577
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
1578
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
1579
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1580
|
+
var __spreadValues$w = (a, b) => {
|
|
1581
1581
|
for (var prop in b || (b = {}))
|
|
1582
|
-
if (__hasOwnProp$
|
|
1583
|
-
__defNormalProp$
|
|
1584
|
-
if (__getOwnPropSymbols$
|
|
1585
|
-
for (var prop of __getOwnPropSymbols$
|
|
1586
|
-
if (__propIsEnum$
|
|
1587
|
-
__defNormalProp$
|
|
1582
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
1583
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
1584
|
+
if (__getOwnPropSymbols$x)
|
|
1585
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
1586
|
+
if (__propIsEnum$x.call(b, prop))
|
|
1587
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
1588
1588
|
}
|
|
1589
1589
|
return a;
|
|
1590
1590
|
};
|
|
1591
|
-
var __spreadProps$
|
|
1591
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
1592
1592
|
var __objRest$4 = (source, exclude) => {
|
|
1593
1593
|
var target = {};
|
|
1594
1594
|
for (var prop in source)
|
|
1595
|
-
if (__hasOwnProp$
|
|
1595
|
+
if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1596
1596
|
target[prop] = source[prop];
|
|
1597
|
-
if (source != null && __getOwnPropSymbols$
|
|
1598
|
-
for (var prop of __getOwnPropSymbols$
|
|
1599
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1597
|
+
if (source != null && __getOwnPropSymbols$x)
|
|
1598
|
+
for (var prop of __getOwnPropSymbols$x(source)) {
|
|
1599
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
|
|
1600
1600
|
target[prop] = source[prop];
|
|
1601
1601
|
}
|
|
1602
1602
|
return target;
|
|
1603
1603
|
};
|
|
1604
|
-
var __async$
|
|
1604
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
1605
1605
|
return new Promise((resolve, reject) => {
|
|
1606
1606
|
var fulfilled = (value) => {
|
|
1607
1607
|
try {
|
|
@@ -1652,7 +1652,7 @@ var NgwMap = (function (exports) {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
function route(name, connector, ...rest) {
|
|
1654
1654
|
const result = {
|
|
1655
|
-
url: (opt) => __async$
|
|
1655
|
+
url: (opt) => __async$u(this, null, function* () {
|
|
1656
1656
|
var _a;
|
|
1657
1657
|
const routeData = yield connector.connect();
|
|
1658
1658
|
const template = routeURL(
|
|
@@ -1680,10 +1680,10 @@ var NgwMap = (function (exports) {
|
|
|
1680
1680
|
routeData,
|
|
1681
1681
|
...rest
|
|
1682
1682
|
);
|
|
1683
|
-
const headers = objectRemoveEmpty(__spreadValues$
|
|
1683
|
+
const headers = objectRemoveEmpty(__spreadValues$w(__spreadValues$w({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
|
|
1684
1684
|
return request(
|
|
1685
1685
|
template,
|
|
1686
|
-
__spreadProps$
|
|
1686
|
+
__spreadProps$j(__spreadValues$w({
|
|
1687
1687
|
headers
|
|
1688
1688
|
}, restOpt), {
|
|
1689
1689
|
method
|
|
@@ -1807,39 +1807,39 @@ var NgwMap = (function (exports) {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
}
|
|
1809
1809
|
|
|
1810
|
-
var __defProp$
|
|
1811
|
-
var __defProps$
|
|
1812
|
-
var __getOwnPropDescs$
|
|
1813
|
-
var __getOwnPropSymbols$
|
|
1814
|
-
var __hasOwnProp$
|
|
1815
|
-
var __propIsEnum$
|
|
1816
|
-
var __defNormalProp$
|
|
1817
|
-
var __spreadValues$
|
|
1810
|
+
var __defProp$H = Object.defineProperty;
|
|
1811
|
+
var __defProps$i = Object.defineProperties;
|
|
1812
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
1813
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
1814
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
1815
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
1816
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1817
|
+
var __spreadValues$v = (a, b) => {
|
|
1818
1818
|
for (var prop in b || (b = {}))
|
|
1819
|
-
if (__hasOwnProp$
|
|
1820
|
-
__defNormalProp$
|
|
1821
|
-
if (__getOwnPropSymbols$
|
|
1822
|
-
for (var prop of __getOwnPropSymbols$
|
|
1823
|
-
if (__propIsEnum$
|
|
1824
|
-
__defNormalProp$
|
|
1819
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
1820
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
1821
|
+
if (__getOwnPropSymbols$w)
|
|
1822
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
1823
|
+
if (__propIsEnum$w.call(b, prop))
|
|
1824
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
1825
1825
|
}
|
|
1826
1826
|
return a;
|
|
1827
1827
|
};
|
|
1828
|
-
var __spreadProps$
|
|
1828
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
1829
1829
|
var __objRest$3 = (source, exclude) => {
|
|
1830
1830
|
var target = {};
|
|
1831
1831
|
for (var prop in source)
|
|
1832
|
-
if (__hasOwnProp$
|
|
1832
|
+
if (__hasOwnProp$w.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1833
1833
|
target[prop] = source[prop];
|
|
1834
|
-
if (source != null && __getOwnPropSymbols$
|
|
1835
|
-
for (var prop of __getOwnPropSymbols$
|
|
1836
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1834
|
+
if (source != null && __getOwnPropSymbols$w)
|
|
1835
|
+
for (var prop of __getOwnPropSymbols$w(source)) {
|
|
1836
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$w.call(source, prop))
|
|
1837
1837
|
target[prop] = source[prop];
|
|
1838
1838
|
}
|
|
1839
1839
|
return target;
|
|
1840
1840
|
};
|
|
1841
|
-
var __publicField$
|
|
1842
|
-
var __async$
|
|
1841
|
+
var __publicField$t = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1842
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
1843
1843
|
return new Promise((resolve, reject) => {
|
|
1844
1844
|
var fulfilled = (value) => {
|
|
1845
1845
|
try {
|
|
@@ -1864,18 +1864,18 @@ var NgwMap = (function (exports) {
|
|
|
1864
1864
|
class NgwConnector {
|
|
1865
1865
|
constructor(options) {
|
|
1866
1866
|
this.options = options;
|
|
1867
|
-
__publicField$
|
|
1868
|
-
__publicField$
|
|
1869
|
-
__publicField$
|
|
1870
|
-
__publicField$
|
|
1871
|
-
__publicField$
|
|
1867
|
+
__publicField$t(this, "id", ID$2++);
|
|
1868
|
+
__publicField$t(this, "emitter", new EventEmitter());
|
|
1869
|
+
__publicField$t(this, "user");
|
|
1870
|
+
__publicField$t(this, "cache");
|
|
1871
|
+
__publicField$t(this, "withCredentials");
|
|
1872
1872
|
// Dedicated cache for route requests, as these are executed before any other requests.
|
|
1873
1873
|
// This cache does not need to be cleared during the session.
|
|
1874
|
-
__publicField$
|
|
1875
|
-
__publicField$
|
|
1876
|
-
__publicField$
|
|
1877
|
-
__publicField$
|
|
1878
|
-
__publicField$
|
|
1874
|
+
__publicField$t(this, "routeCache");
|
|
1875
|
+
__publicField$t(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
1876
|
+
__publicField$t(this, "routeStr", "/api/component/pyramid/route");
|
|
1877
|
+
__publicField$t(this, "activeRequests", {});
|
|
1878
|
+
__publicField$t(this, "requestTransform");
|
|
1879
1879
|
const exist = findConnector(options);
|
|
1880
1880
|
this.cache = new Cache({ namespace: options.cacheId });
|
|
1881
1881
|
this.routeCache = new Cache({ namespace: "routecache" });
|
|
@@ -1928,7 +1928,7 @@ var NgwMap = (function (exports) {
|
|
|
1928
1928
|
* ```
|
|
1929
1929
|
*/
|
|
1930
1930
|
connect() {
|
|
1931
|
-
return __async$
|
|
1931
|
+
return __async$t(this, arguments, function* ({
|
|
1932
1932
|
signal
|
|
1933
1933
|
} = {}) {
|
|
1934
1934
|
const auth = this.options.auth;
|
|
@@ -1967,14 +1967,14 @@ var NgwMap = (function (exports) {
|
|
|
1967
1967
|
this.emitter.emit("logout");
|
|
1968
1968
|
}
|
|
1969
1969
|
getUserInfo(credentials, options) {
|
|
1970
|
-
return __async$
|
|
1970
|
+
return __async$t(this, null, function* () {
|
|
1971
1971
|
if (this.user && this.user.id) {
|
|
1972
1972
|
return this.user;
|
|
1973
1973
|
}
|
|
1974
1974
|
if (credentials) {
|
|
1975
1975
|
this.options.auth = credentials;
|
|
1976
1976
|
}
|
|
1977
|
-
const options_ = __spreadValues$
|
|
1977
|
+
const options_ = __spreadValues$v({
|
|
1978
1978
|
headers: this.getAuthorizationHeaders(credentials),
|
|
1979
1979
|
cache: true
|
|
1980
1980
|
}, options);
|
|
@@ -2015,7 +2015,7 @@ var NgwMap = (function (exports) {
|
|
|
2015
2015
|
this.activeRequests = {};
|
|
2016
2016
|
}
|
|
2017
2017
|
getActiveApiRequests() {
|
|
2018
|
-
return __spreadValues$
|
|
2018
|
+
return __spreadValues$v({}, this.activeRequests);
|
|
2019
2019
|
}
|
|
2020
2020
|
route(name, ...rest) {
|
|
2021
2021
|
return route(name, this, ...rest);
|
|
@@ -2027,7 +2027,7 @@ var NgwMap = (function (exports) {
|
|
|
2027
2027
|
* @param options - Request options
|
|
2028
2028
|
*/
|
|
2029
2029
|
makeQuery(_0, _1) {
|
|
2030
|
-
return __async$
|
|
2030
|
+
return __async$t(this, arguments, function* (url, params, options = {}) {
|
|
2031
2031
|
var _b;
|
|
2032
2032
|
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
2033
2033
|
if (!url) {
|
|
@@ -2038,7 +2038,7 @@ var NgwMap = (function (exports) {
|
|
|
2038
2038
|
url = template(url, restParams);
|
|
2039
2039
|
}
|
|
2040
2040
|
url = encodeURI(fixUrlStr(url));
|
|
2041
|
-
options = __spreadValues$
|
|
2041
|
+
options = __spreadValues$v({ withCredentials: this.withCredentials }, options);
|
|
2042
2042
|
const {
|
|
2043
2043
|
cache,
|
|
2044
2044
|
signal: externalSignal,
|
|
@@ -2060,7 +2060,7 @@ var NgwMap = (function (exports) {
|
|
|
2060
2060
|
});
|
|
2061
2061
|
}
|
|
2062
2062
|
options.signal = internalSignal;
|
|
2063
|
-
const createPromise = () => __async$
|
|
2063
|
+
const createPromise = () => __async$t(this, null, function* () {
|
|
2064
2064
|
const id = REQUEST_ID++;
|
|
2065
2065
|
this.activeRequests[id] = internalAbortController;
|
|
2066
2066
|
try {
|
|
@@ -2070,7 +2070,7 @@ var NgwMap = (function (exports) {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
});
|
|
2072
2072
|
if (method === "GET" && cache !== false) {
|
|
2073
|
-
const cacheOptions = cacheProps ? cacheProps : __spreadProps$
|
|
2073
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$i(__spreadValues$v({}, objectRemoveEmpty({
|
|
2074
2074
|
headers,
|
|
2075
2075
|
withCredentials,
|
|
2076
2076
|
responseType,
|
|
@@ -2093,7 +2093,7 @@ var NgwMap = (function (exports) {
|
|
|
2093
2093
|
var _a;
|
|
2094
2094
|
if (this.user) {
|
|
2095
2095
|
options = options || {};
|
|
2096
|
-
options.headers = __spreadValues$
|
|
2096
|
+
options.headers = __spreadValues$v(__spreadValues$v({}, this.getAuthorizationHeaders()), options.headers);
|
|
2097
2097
|
}
|
|
2098
2098
|
if (this.requestTransform) {
|
|
2099
2099
|
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
@@ -2124,7 +2124,7 @@ var NgwMap = (function (exports) {
|
|
|
2124
2124
|
});
|
|
2125
2125
|
}
|
|
2126
2126
|
_login(credentials, options) {
|
|
2127
|
-
return __async$
|
|
2127
|
+
return __async$t(this, null, function* () {
|
|
2128
2128
|
try {
|
|
2129
2129
|
const data = yield this.getUserInfo(credentials, options);
|
|
2130
2130
|
this.user = data;
|
|
@@ -2152,7 +2152,7 @@ var NgwMap = (function (exports) {
|
|
|
2152
2152
|
return er;
|
|
2153
2153
|
}
|
|
2154
2154
|
}
|
|
2155
|
-
__publicField$
|
|
2155
|
+
__publicField$t(NgwConnector, "errors", errors);
|
|
2156
2156
|
|
|
2157
2157
|
function resourceCompare(res1, res2) {
|
|
2158
2158
|
return objectDeepEqual(res1, res2);
|
|
@@ -2182,27 +2182,27 @@ var NgwMap = (function (exports) {
|
|
|
2182
2182
|
return query;
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
|
-
var __defProp$
|
|
2186
|
-
var __defProps$
|
|
2187
|
-
var __getOwnPropDescs$
|
|
2188
|
-
var __getOwnPropSymbols$
|
|
2189
|
-
var __hasOwnProp$
|
|
2190
|
-
var __propIsEnum$
|
|
2191
|
-
var __defNormalProp$
|
|
2192
|
-
var __spreadValues$
|
|
2185
|
+
var __defProp$G = Object.defineProperty;
|
|
2186
|
+
var __defProps$h = Object.defineProperties;
|
|
2187
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
2188
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
2189
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
2190
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
2191
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2192
|
+
var __spreadValues$u = (a, b) => {
|
|
2193
2193
|
for (var prop in b || (b = {}))
|
|
2194
|
-
if (__hasOwnProp$
|
|
2195
|
-
__defNormalProp$
|
|
2196
|
-
if (__getOwnPropSymbols$
|
|
2197
|
-
for (var prop of __getOwnPropSymbols$
|
|
2198
|
-
if (__propIsEnum$
|
|
2199
|
-
__defNormalProp$
|
|
2194
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
2195
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
2196
|
+
if (__getOwnPropSymbols$v)
|
|
2197
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
2198
|
+
if (__propIsEnum$v.call(b, prop))
|
|
2199
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
2200
2200
|
}
|
|
2201
2201
|
return a;
|
|
2202
2202
|
};
|
|
2203
|
-
var __spreadProps$
|
|
2204
|
-
var __publicField$
|
|
2205
|
-
var __async$
|
|
2203
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
2204
|
+
var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2205
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
2206
2206
|
return new Promise((resolve, reject) => {
|
|
2207
2207
|
var fulfilled = (value) => {
|
|
2208
2208
|
try {
|
|
@@ -2227,8 +2227,8 @@ var NgwMap = (function (exports) {
|
|
|
2227
2227
|
connector,
|
|
2228
2228
|
cacheId
|
|
2229
2229
|
}) {
|
|
2230
|
-
__publicField$
|
|
2231
|
-
__publicField$
|
|
2230
|
+
__publicField$s(this, "cache");
|
|
2231
|
+
__publicField$s(this, "connector");
|
|
2232
2232
|
this.connector = connector;
|
|
2233
2233
|
this.cache = new Cache({ namespace: cacheId });
|
|
2234
2234
|
}
|
|
@@ -2243,7 +2243,7 @@ var NgwMap = (function (exports) {
|
|
|
2243
2243
|
* Fetching resource would be cached to speed up next call
|
|
2244
2244
|
*/
|
|
2245
2245
|
getOne(resource, requestOptions) {
|
|
2246
|
-
const opt = __spreadValues$
|
|
2246
|
+
const opt = __spreadValues$u({}, requestOptions);
|
|
2247
2247
|
if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
|
|
2248
2248
|
if (resource.id !== void 0) {
|
|
2249
2249
|
resource.id;
|
|
@@ -2320,8 +2320,8 @@ var NgwMap = (function (exports) {
|
|
|
2320
2320
|
} else {
|
|
2321
2321
|
Object.assign(query, resourceToQuery(resource));
|
|
2322
2322
|
}
|
|
2323
|
-
return this.connector.route("resource.search").get(__spreadProps$
|
|
2324
|
-
query: __spreadValues$
|
|
2323
|
+
return this.connector.route("resource.search").get(__spreadProps$h(__spreadValues$u({}, requestOptions), {
|
|
2324
|
+
query: __spreadValues$u({
|
|
2325
2325
|
serialization: "full"
|
|
2326
2326
|
}, query)
|
|
2327
2327
|
})).then((resources) => {
|
|
@@ -2374,7 +2374,7 @@ var NgwMap = (function (exports) {
|
|
|
2374
2374
|
});
|
|
2375
2375
|
}
|
|
2376
2376
|
_getChildrenOf(_0, _1) {
|
|
2377
|
-
return __async$
|
|
2377
|
+
return __async$s(this, arguments, function* (parentDef, requestOptions, _items = []) {
|
|
2378
2378
|
let parent = void 0;
|
|
2379
2379
|
if (typeof parentDef === "string") {
|
|
2380
2380
|
parent = yield this.getId(parentDef, requestOptions);
|
|
@@ -2383,7 +2383,7 @@ var NgwMap = (function (exports) {
|
|
|
2383
2383
|
} else {
|
|
2384
2384
|
parent = parentDef;
|
|
2385
2385
|
}
|
|
2386
|
-
const items = yield this.connector.route("resource.collection").get(__spreadProps$
|
|
2386
|
+
const items = yield this.connector.route("resource.collection").get(__spreadProps$h(__spreadValues$u({}, requestOptions), {
|
|
2387
2387
|
query: {
|
|
2388
2388
|
parent
|
|
2389
2389
|
}
|
|
@@ -2411,7 +2411,7 @@ var NgwMap = (function (exports) {
|
|
|
2411
2411
|
});
|
|
2412
2412
|
}
|
|
2413
2413
|
_cleanResourceItemCache(id) {
|
|
2414
|
-
return __async$
|
|
2414
|
+
return __async$s(this, null, function* () {
|
|
2415
2415
|
var _a;
|
|
2416
2416
|
const all = this.cache.all();
|
|
2417
2417
|
const toDelete = [];
|
|
@@ -2464,13 +2464,13 @@ var NgwMap = (function (exports) {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
2466
|
|
|
2467
|
-
var __defProp$
|
|
2468
|
-
var __defNormalProp$
|
|
2469
|
-
var __publicField$
|
|
2467
|
+
var __defProp$F = Object.defineProperty;
|
|
2468
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2469
|
+
var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, key + "" , value);
|
|
2470
2470
|
class NgwConnectorExtended extends NgwConnector {
|
|
2471
2471
|
constructor(options) {
|
|
2472
2472
|
super(options);
|
|
2473
|
-
__publicField$
|
|
2473
|
+
__publicField$r(this, "resources");
|
|
2474
2474
|
this.resources = new ResourcesControl({
|
|
2475
2475
|
connector: this,
|
|
2476
2476
|
cacheId: options.cacheId
|
|
@@ -2680,25 +2680,25 @@ var NgwMap = (function (exports) {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
2682
|
|
|
2683
|
-
var __defProp$
|
|
2684
|
-
var __defProps$
|
|
2685
|
-
var __getOwnPropDescs$
|
|
2686
|
-
var __getOwnPropSymbols$
|
|
2687
|
-
var __hasOwnProp$
|
|
2688
|
-
var __propIsEnum$
|
|
2689
|
-
var __defNormalProp$
|
|
2690
|
-
var __spreadValues$
|
|
2683
|
+
var __defProp$E = Object.defineProperty;
|
|
2684
|
+
var __defProps$g = Object.defineProperties;
|
|
2685
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
2686
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
2687
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
2688
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
2689
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2690
|
+
var __spreadValues$t = (a, b) => {
|
|
2691
2691
|
for (var prop in b || (b = {}))
|
|
2692
|
-
if (__hasOwnProp$
|
|
2693
|
-
__defNormalProp$
|
|
2694
|
-
if (__getOwnPropSymbols$
|
|
2695
|
-
for (var prop of __getOwnPropSymbols$
|
|
2696
|
-
if (__propIsEnum$
|
|
2697
|
-
__defNormalProp$
|
|
2692
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
2693
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
2694
|
+
if (__getOwnPropSymbols$u)
|
|
2695
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
2696
|
+
if (__propIsEnum$u.call(b, prop))
|
|
2697
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
2698
2698
|
}
|
|
2699
2699
|
return a;
|
|
2700
2700
|
};
|
|
2701
|
-
var __spreadProps$
|
|
2701
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
2702
2702
|
function getNgwWebmapExtent(webmap) {
|
|
2703
2703
|
const bottom = webmap["extent_bottom"];
|
|
2704
2704
|
const left = webmap["extent_left"];
|
|
@@ -2765,14 +2765,14 @@ var NgwMap = (function (exports) {
|
|
|
2765
2765
|
if (resource.cls && resource.parent && resource.cls.indexOf("style") !== -1) {
|
|
2766
2766
|
return connector.getResource(resource.parent.id, options).then((res) => {
|
|
2767
2767
|
if (res) {
|
|
2768
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2768
|
+
return fetchNgwLayerExtent(__spreadProps$g(__spreadValues$t({}, options), {
|
|
2769
2769
|
resourceId: res.resource.id,
|
|
2770
2770
|
connector
|
|
2771
2771
|
}));
|
|
2772
2772
|
}
|
|
2773
2773
|
});
|
|
2774
2774
|
} else {
|
|
2775
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2775
|
+
return fetchNgwLayerExtent(__spreadProps$g(__spreadValues$t({}, options), {
|
|
2776
2776
|
resourceId: resource.id,
|
|
2777
2777
|
connector
|
|
2778
2778
|
}));
|
|
@@ -2780,10 +2780,10 @@ var NgwMap = (function (exports) {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
}
|
|
2782
2782
|
|
|
2783
|
-
var __defProp$
|
|
2784
|
-
var __defNormalProp$
|
|
2785
|
-
var __publicField$
|
|
2786
|
-
var __async$
|
|
2783
|
+
var __defProp$D = Object.defineProperty;
|
|
2784
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2785
|
+
var __publicField$q = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2786
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
2787
2787
|
return new Promise((resolve, reject) => {
|
|
2788
2788
|
var fulfilled = (value) => {
|
|
2789
2789
|
try {
|
|
@@ -2805,18 +2805,18 @@ var NgwMap = (function (exports) {
|
|
|
2805
2805
|
};
|
|
2806
2806
|
class NgwResource {
|
|
2807
2807
|
constructor() {
|
|
2808
|
-
__publicField$
|
|
2809
|
-
__publicField$
|
|
2810
|
-
__publicField$
|
|
2808
|
+
__publicField$q(this, "item");
|
|
2809
|
+
__publicField$q(this, "connector");
|
|
2810
|
+
__publicField$q(this, "_extent");
|
|
2811
2811
|
}
|
|
2812
2812
|
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
2813
2813
|
getExtent() {
|
|
2814
|
-
return __async$
|
|
2814
|
+
return __async$r(this, null, function* () {
|
|
2815
2815
|
return this.getBounds();
|
|
2816
2816
|
});
|
|
2817
2817
|
}
|
|
2818
2818
|
getBounds(options) {
|
|
2819
|
-
return __async$
|
|
2819
|
+
return __async$r(this, null, function* () {
|
|
2820
2820
|
if (this._extent) {
|
|
2821
2821
|
return this._extent;
|
|
2822
2822
|
}
|
|
@@ -2832,7 +2832,7 @@ var NgwMap = (function (exports) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
2834
2834
|
|
|
2835
|
-
var __async$
|
|
2835
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
2836
2836
|
return new Promise((resolve, reject) => {
|
|
2837
2837
|
var fulfilled = (value) => {
|
|
2838
2838
|
try {
|
|
@@ -2853,7 +2853,7 @@ var NgwMap = (function (exports) {
|
|
|
2853
2853
|
});
|
|
2854
2854
|
};
|
|
2855
2855
|
function resourceIdFromLayerOptions(options, connector) {
|
|
2856
|
-
return __async$
|
|
2856
|
+
return __async$q(this, null, function* () {
|
|
2857
2857
|
const resource = options.resource;
|
|
2858
2858
|
const item = resource;
|
|
2859
2859
|
let { keyname, resourceId } = options;
|
|
@@ -2878,24 +2878,24 @@ var NgwMap = (function (exports) {
|
|
|
2878
2878
|
});
|
|
2879
2879
|
}
|
|
2880
2880
|
|
|
2881
|
-
var __defProp$
|
|
2882
|
-
var __getOwnPropSymbols$
|
|
2883
|
-
var __hasOwnProp$
|
|
2884
|
-
var __propIsEnum$
|
|
2885
|
-
var __defNormalProp$
|
|
2886
|
-
var __spreadValues$
|
|
2881
|
+
var __defProp$C = Object.defineProperty;
|
|
2882
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
2883
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
2884
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
2885
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2886
|
+
var __spreadValues$s = (a, b) => {
|
|
2887
2887
|
for (var prop in b || (b = {}))
|
|
2888
|
-
if (__hasOwnProp$
|
|
2889
|
-
__defNormalProp$
|
|
2890
|
-
if (__getOwnPropSymbols$
|
|
2891
|
-
for (var prop of __getOwnPropSymbols$
|
|
2892
|
-
if (__propIsEnum$
|
|
2893
|
-
__defNormalProp$
|
|
2888
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
2889
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2890
|
+
if (__getOwnPropSymbols$t)
|
|
2891
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
2892
|
+
if (__propIsEnum$t.call(b, prop))
|
|
2893
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2894
2894
|
}
|
|
2895
2895
|
return a;
|
|
2896
2896
|
};
|
|
2897
|
-
var __publicField$
|
|
2898
|
-
var __async$
|
|
2897
|
+
var __publicField$p = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2898
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
2899
2899
|
return new Promise((resolve, reject) => {
|
|
2900
2900
|
var fulfilled = (value) => {
|
|
2901
2901
|
try {
|
|
@@ -2916,7 +2916,7 @@ var NgwMap = (function (exports) {
|
|
|
2916
2916
|
});
|
|
2917
2917
|
};
|
|
2918
2918
|
function createOnFirstShowAdapter(_0) {
|
|
2919
|
-
return __async$
|
|
2919
|
+
return __async$p(this, arguments, function* ({
|
|
2920
2920
|
webMap,
|
|
2921
2921
|
adapterOptions = {},
|
|
2922
2922
|
onLayerAdded,
|
|
@@ -2924,10 +2924,10 @@ var NgwMap = (function (exports) {
|
|
|
2924
2924
|
}) {
|
|
2925
2925
|
class OnFirstShowAdapter {
|
|
2926
2926
|
constructor() {
|
|
2927
|
-
__publicField$
|
|
2928
|
-
__publicField$
|
|
2929
|
-
__publicField$
|
|
2930
|
-
__publicField$
|
|
2927
|
+
__publicField$p(this, "options", {});
|
|
2928
|
+
__publicField$p(this, "layer", []);
|
|
2929
|
+
__publicField$p(this, "_removed", false);
|
|
2930
|
+
__publicField$p(this, "_creatingInProgress", false);
|
|
2931
2931
|
}
|
|
2932
2932
|
addLayer() {
|
|
2933
2933
|
return this.layer;
|
|
@@ -2942,7 +2942,7 @@ var NgwMap = (function (exports) {
|
|
|
2942
2942
|
return this._removed;
|
|
2943
2943
|
}
|
|
2944
2944
|
showLayer() {
|
|
2945
|
-
return __async$
|
|
2945
|
+
return __async$p(this, null, function* () {
|
|
2946
2946
|
this.options.visibility = true;
|
|
2947
2947
|
if (this.layer.length) {
|
|
2948
2948
|
for (const x of this.layer) {
|
|
@@ -2954,7 +2954,7 @@ var NgwMap = (function (exports) {
|
|
|
2954
2954
|
});
|
|
2955
2955
|
}
|
|
2956
2956
|
hideLayer() {
|
|
2957
|
-
return __async$
|
|
2957
|
+
return __async$p(this, null, function* () {
|
|
2958
2958
|
this.options.visibility = false;
|
|
2959
2959
|
if (this.layer) {
|
|
2960
2960
|
for (const x of this.layer) {
|
|
@@ -2964,12 +2964,12 @@ var NgwMap = (function (exports) {
|
|
|
2964
2964
|
});
|
|
2965
2965
|
}
|
|
2966
2966
|
loadLayer() {
|
|
2967
|
-
return __async$
|
|
2967
|
+
return __async$p(this, null, function* () {
|
|
2968
2968
|
if (!this.layer.length && !this._creatingInProgress) {
|
|
2969
2969
|
this._creatingInProgress = true;
|
|
2970
2970
|
const Adapter = yield createAdapter(this);
|
|
2971
2971
|
if (Adapter) {
|
|
2972
|
-
const adapter = new Adapter(webMap.mapAdapter.map, __spreadValues$
|
|
2972
|
+
const adapter = new Adapter(webMap.mapAdapter.map, __spreadValues$s({}, adapterOptions));
|
|
2973
2973
|
const realLayer = yield adapter.addLayer({
|
|
2974
2974
|
order: this.options.order,
|
|
2975
2975
|
headers: this.options.headers,
|
|
@@ -2998,7 +2998,7 @@ var NgwMap = (function (exports) {
|
|
|
2998
2998
|
});
|
|
2999
2999
|
}
|
|
3000
3000
|
|
|
3001
|
-
var __async$
|
|
3001
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
3002
3002
|
return new Promise((resolve, reject) => {
|
|
3003
3003
|
var fulfilled = (value) => {
|
|
3004
3004
|
try {
|
|
@@ -3019,7 +3019,7 @@ var NgwMap = (function (exports) {
|
|
|
3019
3019
|
});
|
|
3020
3020
|
};
|
|
3021
3021
|
function createOnFirstShowNgwAdapter(_0) {
|
|
3022
|
-
return __async$
|
|
3022
|
+
return __async$o(this, arguments, function* ({
|
|
3023
3023
|
webMap,
|
|
3024
3024
|
connector,
|
|
3025
3025
|
item,
|
|
@@ -3053,19 +3053,19 @@ var NgwMap = (function (exports) {
|
|
|
3053
3053
|
});
|
|
3054
3054
|
}
|
|
3055
3055
|
|
|
3056
|
-
var __defProp$
|
|
3057
|
-
var __getOwnPropSymbols$
|
|
3058
|
-
var __hasOwnProp$
|
|
3059
|
-
var __propIsEnum$
|
|
3060
|
-
var __defNormalProp$
|
|
3061
|
-
var __spreadValues$
|
|
3056
|
+
var __defProp$B = Object.defineProperty;
|
|
3057
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
3058
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
3059
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
3060
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3061
|
+
var __spreadValues$r = (a, b) => {
|
|
3062
3062
|
for (var prop in b || (b = {}))
|
|
3063
|
-
if (__hasOwnProp$
|
|
3064
|
-
__defNormalProp$
|
|
3065
|
-
if (__getOwnPropSymbols$
|
|
3066
|
-
for (var prop of __getOwnPropSymbols$
|
|
3067
|
-
if (__propIsEnum$
|
|
3068
|
-
__defNormalProp$
|
|
3063
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
3064
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
3065
|
+
if (__getOwnPropSymbols$s)
|
|
3066
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
3067
|
+
if (__propIsEnum$s.call(b, prop))
|
|
3068
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
3069
3069
|
}
|
|
3070
3070
|
return a;
|
|
3071
3071
|
};
|
|
@@ -3112,7 +3112,7 @@ var NgwMap = (function (exports) {
|
|
|
3112
3112
|
return false;
|
|
3113
3113
|
}
|
|
3114
3114
|
function featureFilter(feature, filters) {
|
|
3115
|
-
const properties = __spreadValues$
|
|
3115
|
+
const properties = __spreadValues$r({}, feature.properties);
|
|
3116
3116
|
if (properties) {
|
|
3117
3117
|
properties.$id = feature.id;
|
|
3118
3118
|
return propertiesFilter(properties, filters);
|
|
@@ -3151,26 +3151,26 @@ var NgwMap = (function (exports) {
|
|
|
3151
3151
|
defaultRequestLimit: 7e3
|
|
3152
3152
|
};
|
|
3153
3153
|
|
|
3154
|
-
var __defProp$
|
|
3155
|
-
var __defProps$
|
|
3156
|
-
var __getOwnPropDescs$
|
|
3157
|
-
var __getOwnPropSymbols$
|
|
3158
|
-
var __hasOwnProp$
|
|
3159
|
-
var __propIsEnum$
|
|
3160
|
-
var __defNormalProp$
|
|
3161
|
-
var __spreadValues$
|
|
3154
|
+
var __defProp$A = Object.defineProperty;
|
|
3155
|
+
var __defProps$f = Object.defineProperties;
|
|
3156
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
3157
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
3158
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
3159
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
3160
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3161
|
+
var __spreadValues$q = (a, b) => {
|
|
3162
3162
|
for (var prop in b || (b = {}))
|
|
3163
|
-
if (__hasOwnProp$
|
|
3164
|
-
__defNormalProp$
|
|
3165
|
-
if (__getOwnPropSymbols$
|
|
3166
|
-
for (var prop of __getOwnPropSymbols$
|
|
3167
|
-
if (__propIsEnum$
|
|
3168
|
-
__defNormalProp$
|
|
3163
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
3164
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
3165
|
+
if (__getOwnPropSymbols$r)
|
|
3166
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
3167
|
+
if (__propIsEnum$r.call(b, prop))
|
|
3168
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
3169
3169
|
}
|
|
3170
3170
|
return a;
|
|
3171
3171
|
};
|
|
3172
|
-
var __spreadProps$
|
|
3173
|
-
var __async$
|
|
3172
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
3173
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
3174
3174
|
return new Promise((resolve, reject) => {
|
|
3175
3175
|
var fulfilled = (value) => {
|
|
3176
3176
|
try {
|
|
@@ -3237,7 +3237,7 @@ var NgwMap = (function (exports) {
|
|
|
3237
3237
|
);
|
|
3238
3238
|
}
|
|
3239
3239
|
function createFeatureFieldFilterQueries(opt) {
|
|
3240
|
-
return __async$
|
|
3240
|
+
return __async$n(this, null, function* () {
|
|
3241
3241
|
const queries = getQueries(opt);
|
|
3242
3242
|
const itemsParts = yield Promise.all(queries);
|
|
3243
3243
|
const ids = [];
|
|
@@ -3281,13 +3281,13 @@ var NgwMap = (function (exports) {
|
|
|
3281
3281
|
for (const f of filters_) {
|
|
3282
3282
|
if (isPropertyFilter(f)) {
|
|
3283
3283
|
_queries.push(
|
|
3284
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3284
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3285
3285
|
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
3286
3286
|
}))
|
|
3287
3287
|
);
|
|
3288
3288
|
} else {
|
|
3289
3289
|
getQueries(
|
|
3290
|
-
__spreadProps$
|
|
3290
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3291
3291
|
filters: f
|
|
3292
3292
|
}),
|
|
3293
3293
|
_queries,
|
|
@@ -3308,7 +3308,7 @@ var NgwMap = (function (exports) {
|
|
|
3308
3308
|
if (propertiesFilterList.length) {
|
|
3309
3309
|
for (const x of propertiesFilterList) {
|
|
3310
3310
|
getQueries(
|
|
3311
|
-
__spreadProps$
|
|
3311
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3312
3312
|
filters: x
|
|
3313
3313
|
}),
|
|
3314
3314
|
_queries,
|
|
@@ -3317,7 +3317,7 @@ var NgwMap = (function (exports) {
|
|
|
3317
3317
|
}
|
|
3318
3318
|
} else {
|
|
3319
3319
|
_queries.push(
|
|
3320
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3320
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3321
3321
|
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
3322
3322
|
}))
|
|
3323
3323
|
);
|
|
@@ -3333,7 +3333,7 @@ var NgwMap = (function (exports) {
|
|
|
3333
3333
|
return `POLYGON((${polygon.join(", ")}))`;
|
|
3334
3334
|
}
|
|
3335
3335
|
function fetchNgwLayerItemsRequest(options) {
|
|
3336
|
-
const params = __spreadValues$
|
|
3336
|
+
const params = __spreadValues$q({}, FEATURE_REQUEST_PARAMS);
|
|
3337
3337
|
const {
|
|
3338
3338
|
limit,
|
|
3339
3339
|
query,
|
|
@@ -3371,7 +3371,7 @@ var NgwMap = (function (exports) {
|
|
|
3371
3371
|
if (paramList) {
|
|
3372
3372
|
Object.assign(params, paramListToQuery(paramList));
|
|
3373
3373
|
}
|
|
3374
|
-
return connector.route("feature_layer.feature.collection", { id: Number(resourceId) }).get({ query: __spreadValues$
|
|
3374
|
+
return connector.route("feature_layer.feature.collection", { id: Number(resourceId) }).get({ query: __spreadValues$q(__spreadValues$q({}, params), query), cache, signal });
|
|
3375
3375
|
}
|
|
3376
3376
|
|
|
3377
3377
|
function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
@@ -3400,26 +3400,26 @@ var NgwMap = (function (exports) {
|
|
|
3400
3400
|
return fields;
|
|
3401
3401
|
}
|
|
3402
3402
|
|
|
3403
|
-
var __defProp$
|
|
3404
|
-
var __defProps$
|
|
3405
|
-
var __getOwnPropDescs$
|
|
3406
|
-
var __getOwnPropSymbols$
|
|
3407
|
-
var __hasOwnProp$
|
|
3408
|
-
var __propIsEnum$
|
|
3409
|
-
var __defNormalProp$
|
|
3410
|
-
var __spreadValues$
|
|
3403
|
+
var __defProp$z = Object.defineProperty;
|
|
3404
|
+
var __defProps$e = Object.defineProperties;
|
|
3405
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
3406
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
3407
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
3408
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
3409
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3410
|
+
var __spreadValues$p = (a, b) => {
|
|
3411
3411
|
for (var prop in b || (b = {}))
|
|
3412
|
-
if (__hasOwnProp$
|
|
3413
|
-
__defNormalProp$
|
|
3414
|
-
if (__getOwnPropSymbols$
|
|
3415
|
-
for (var prop of __getOwnPropSymbols$
|
|
3416
|
-
if (__propIsEnum$
|
|
3417
|
-
__defNormalProp$
|
|
3412
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
3413
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
3414
|
+
if (__getOwnPropSymbols$q)
|
|
3415
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
3416
|
+
if (__propIsEnum$q.call(b, prop))
|
|
3417
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
3418
3418
|
}
|
|
3419
3419
|
return a;
|
|
3420
3420
|
};
|
|
3421
|
-
var __spreadProps$
|
|
3422
|
-
var __async$
|
|
3421
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
3422
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
3423
3423
|
return new Promise((resolve, reject) => {
|
|
3424
3424
|
var fulfilled = (value) => {
|
|
3425
3425
|
try {
|
|
@@ -3440,17 +3440,17 @@ var NgwMap = (function (exports) {
|
|
|
3440
3440
|
});
|
|
3441
3441
|
};
|
|
3442
3442
|
function fetchNgwLayerItems(options) {
|
|
3443
|
-
return __async$
|
|
3443
|
+
return __async$m(this, null, function* () {
|
|
3444
3444
|
var _a;
|
|
3445
3445
|
const filters = options.filters;
|
|
3446
3446
|
if (filters) {
|
|
3447
|
-
let data = yield createFeatureFieldFilterQueries(__spreadProps$
|
|
3447
|
+
let data = yield createFeatureFieldFilterQueries(__spreadProps$e(__spreadValues$p({}, options), {
|
|
3448
3448
|
filters
|
|
3449
3449
|
}));
|
|
3450
3450
|
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
|
|
3451
3451
|
if (clientFilterValidate) {
|
|
3452
3452
|
data = data.filter((y) => {
|
|
3453
|
-
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$
|
|
3453
|
+
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$e(__spreadValues$p({}, y.fields), {
|
|
3454
3454
|
id: y.id
|
|
3455
3455
|
}));
|
|
3456
3456
|
const result = propertiesFilter(fields, filters);
|
|
@@ -3568,26 +3568,26 @@ var NgwMap = (function (exports) {
|
|
|
3568
3568
|
}
|
|
3569
3569
|
}
|
|
3570
3570
|
|
|
3571
|
-
var __defProp$
|
|
3572
|
-
var __defProps$
|
|
3573
|
-
var __getOwnPropDescs$
|
|
3574
|
-
var __getOwnPropSymbols$
|
|
3575
|
-
var __hasOwnProp$
|
|
3576
|
-
var __propIsEnum$
|
|
3577
|
-
var __defNormalProp$
|
|
3578
|
-
var __spreadValues$
|
|
3571
|
+
var __defProp$y = Object.defineProperty;
|
|
3572
|
+
var __defProps$d = Object.defineProperties;
|
|
3573
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
3574
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
3575
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
3576
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
3577
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3578
|
+
var __spreadValues$o = (a, b) => {
|
|
3579
3579
|
for (var prop in b || (b = {}))
|
|
3580
|
-
if (__hasOwnProp$
|
|
3581
|
-
__defNormalProp$
|
|
3582
|
-
if (__getOwnPropSymbols$
|
|
3583
|
-
for (var prop of __getOwnPropSymbols$
|
|
3584
|
-
if (__propIsEnum$
|
|
3585
|
-
__defNormalProp$
|
|
3580
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
3581
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
3582
|
+
if (__getOwnPropSymbols$p)
|
|
3583
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
3584
|
+
if (__propIsEnum$p.call(b, prop))
|
|
3585
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
3586
3586
|
}
|
|
3587
3587
|
return a;
|
|
3588
3588
|
};
|
|
3589
|
-
var __spreadProps$
|
|
3590
|
-
var __async$
|
|
3589
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
3590
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
3591
3591
|
return new Promise((resolve, reject) => {
|
|
3592
3592
|
var fulfilled = (value) => {
|
|
3593
3593
|
try {
|
|
@@ -3608,56 +3608,56 @@ var NgwMap = (function (exports) {
|
|
|
3608
3608
|
});
|
|
3609
3609
|
};
|
|
3610
3610
|
function fetchNgwLayerItem(options) {
|
|
3611
|
-
return __async$
|
|
3612
|
-
const params = __spreadValues$
|
|
3611
|
+
return __async$l(this, null, function* () {
|
|
3612
|
+
const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
|
|
3613
3613
|
updateItemRequestParam(params, options);
|
|
3614
3614
|
const resp = yield options.connector.route("feature_layer.feature.item", {
|
|
3615
3615
|
id: Number(options.resourceId),
|
|
3616
3616
|
fid: options.featureId
|
|
3617
|
-
}).get(__spreadProps$
|
|
3618
|
-
const toGeojson = () => __async$
|
|
3617
|
+
}).get(__spreadProps$d(__spreadValues$o({}, options), { query: params }));
|
|
3618
|
+
const toGeojson = () => __async$l(this, null, function* () {
|
|
3619
3619
|
if (resp.geom) {
|
|
3620
3620
|
return createGeoJsonFeature(resp);
|
|
3621
3621
|
} else {
|
|
3622
|
-
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$
|
|
3622
|
+
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$d(__spreadValues$o({}, options), {
|
|
3623
3623
|
geom: true,
|
|
3624
3624
|
fields: null,
|
|
3625
3625
|
extensions: null
|
|
3626
3626
|
}));
|
|
3627
3627
|
const geom = onlyGeomItem.geom;
|
|
3628
|
-
return createGeoJsonFeature(__spreadProps$
|
|
3628
|
+
return createGeoJsonFeature(__spreadProps$d(__spreadValues$o({}, resp), { geom }));
|
|
3629
3629
|
}
|
|
3630
3630
|
});
|
|
3631
|
-
return __spreadProps$
|
|
3631
|
+
return __spreadProps$d(__spreadValues$o({}, resp), {
|
|
3632
3632
|
toGeojson
|
|
3633
3633
|
});
|
|
3634
3634
|
});
|
|
3635
3635
|
}
|
|
3636
3636
|
|
|
3637
|
-
var __defProp$
|
|
3638
|
-
var __getOwnPropSymbols$
|
|
3639
|
-
var __hasOwnProp$
|
|
3640
|
-
var __propIsEnum$
|
|
3641
|
-
var __defNormalProp$
|
|
3642
|
-
var __spreadValues$
|
|
3637
|
+
var __defProp$x = Object.defineProperty;
|
|
3638
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
3639
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
3640
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
3641
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3642
|
+
var __spreadValues$n = (a, b) => {
|
|
3643
3643
|
for (var prop in b || (b = {}))
|
|
3644
|
-
if (__hasOwnProp$
|
|
3645
|
-
__defNormalProp$
|
|
3646
|
-
if (__getOwnPropSymbols$
|
|
3647
|
-
for (var prop of __getOwnPropSymbols$
|
|
3648
|
-
if (__propIsEnum$
|
|
3649
|
-
__defNormalProp$
|
|
3644
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
3645
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
3646
|
+
if (__getOwnPropSymbols$o)
|
|
3647
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
3648
|
+
if (__propIsEnum$o.call(b, prop))
|
|
3649
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
3650
3650
|
}
|
|
3651
3651
|
return a;
|
|
3652
3652
|
};
|
|
3653
|
-
var __publicField$
|
|
3653
|
+
var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3654
3654
|
class BookmarkItem {
|
|
3655
3655
|
constructor(options) {
|
|
3656
3656
|
this.options = options;
|
|
3657
|
-
__publicField$
|
|
3658
|
-
__publicField$
|
|
3659
|
-
__publicField$
|
|
3660
|
-
__publicField$
|
|
3657
|
+
__publicField$o(this, "name");
|
|
3658
|
+
__publicField$o(this, "resourceId");
|
|
3659
|
+
__publicField$o(this, "item");
|
|
3660
|
+
__publicField$o(this, "_extent");
|
|
3661
3661
|
this.resourceId = options.resourceId;
|
|
3662
3662
|
const item = options.item;
|
|
3663
3663
|
this.item = item;
|
|
@@ -3687,7 +3687,7 @@ var NgwMap = (function (exports) {
|
|
|
3687
3687
|
if (this.item.geom) {
|
|
3688
3688
|
return Promise.resolve(createGeoJsonFeature(this.item));
|
|
3689
3689
|
} else {
|
|
3690
|
-
return fetchNgwLayerItem(__spreadValues$
|
|
3690
|
+
return fetchNgwLayerItem(__spreadValues$n({
|
|
3691
3691
|
resourceId: this.resourceId,
|
|
3692
3692
|
featureId: this.item.id,
|
|
3693
3693
|
connector: this.options.connector,
|
|
@@ -3705,19 +3705,19 @@ var NgwMap = (function (exports) {
|
|
|
3705
3705
|
|
|
3706
3706
|
const WEBMAP_BASELAYER_ID_PREFIX = "webmap-baselayer";
|
|
3707
3707
|
|
|
3708
|
-
var __defProp$
|
|
3709
|
-
var __defNormalProp$
|
|
3710
|
-
var __publicField$
|
|
3708
|
+
var __defProp$w = Object.defineProperty;
|
|
3709
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3710
|
+
var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3711
3711
|
class BaseProperty {
|
|
3712
3712
|
constructor(name, item, options) {
|
|
3713
|
-
__publicField$
|
|
3714
|
-
__publicField$
|
|
3715
|
-
__publicField$
|
|
3716
|
-
__publicField$
|
|
3717
|
-
__publicField$
|
|
3718
|
-
__publicField$
|
|
3719
|
-
__publicField$
|
|
3720
|
-
__publicField$
|
|
3713
|
+
__publicField$n(this, "options");
|
|
3714
|
+
__publicField$n(this, "emitter", new EventEmitter());
|
|
3715
|
+
__publicField$n(this, "name");
|
|
3716
|
+
__publicField$n(this, "item");
|
|
3717
|
+
__publicField$n(this, "_blocked", false);
|
|
3718
|
+
__publicField$n(this, "_container");
|
|
3719
|
+
__publicField$n(this, "_value");
|
|
3720
|
+
__publicField$n(this, "_removeEventsListener");
|
|
3721
3721
|
this.item = item;
|
|
3722
3722
|
this.options = Object.assign({}, options);
|
|
3723
3723
|
this.name = name;
|
|
@@ -3814,26 +3814,26 @@ var NgwMap = (function (exports) {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
}
|
|
3816
3816
|
|
|
3817
|
-
var __defProp$
|
|
3818
|
-
var __getOwnPropSymbols$
|
|
3819
|
-
var __hasOwnProp$
|
|
3820
|
-
var __propIsEnum$
|
|
3821
|
-
var __defNormalProp$
|
|
3822
|
-
var __spreadValues$
|
|
3817
|
+
var __defProp$v = Object.defineProperty;
|
|
3818
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
3819
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
3820
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
3821
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3822
|
+
var __spreadValues$m = (a, b) => {
|
|
3823
3823
|
for (var prop in b || (b = {}))
|
|
3824
|
-
if (__hasOwnProp$
|
|
3825
|
-
__defNormalProp$
|
|
3826
|
-
if (__getOwnPropSymbols$
|
|
3827
|
-
for (var prop of __getOwnPropSymbols$
|
|
3828
|
-
if (__propIsEnum$
|
|
3829
|
-
__defNormalProp$
|
|
3824
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
3825
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
3826
|
+
if (__getOwnPropSymbols$n)
|
|
3827
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
3828
|
+
if (__propIsEnum$n.call(b, prop))
|
|
3829
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
3830
3830
|
}
|
|
3831
3831
|
return a;
|
|
3832
3832
|
};
|
|
3833
|
-
var __publicField$
|
|
3833
|
+
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, key + "" , value);
|
|
3834
3834
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
3835
3835
|
constructor(name, item, options) {
|
|
3836
|
-
super(name, item, __spreadValues$
|
|
3836
|
+
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
3837
3837
|
this.set(this.get());
|
|
3838
3838
|
}
|
|
3839
3839
|
update(value, options) {
|
|
@@ -3929,7 +3929,7 @@ var NgwMap = (function (exports) {
|
|
|
3929
3929
|
const child = children[fry];
|
|
3930
3930
|
const property = child.properties && child.properties.property(this.name);
|
|
3931
3931
|
if (property) {
|
|
3932
|
-
property.set(value, __spreadValues$
|
|
3932
|
+
property.set(value, __spreadValues$m(__spreadValues$m({}, options), {
|
|
3933
3933
|
propagation: true,
|
|
3934
3934
|
bubble: false
|
|
3935
3935
|
}));
|
|
@@ -3938,7 +3938,7 @@ var NgwMap = (function (exports) {
|
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
3940
3940
|
};
|
|
3941
|
-
__publicField$
|
|
3941
|
+
__publicField$m(_CheckProperty, "options", {
|
|
3942
3942
|
hierarchy: true,
|
|
3943
3943
|
bubble: false,
|
|
3944
3944
|
propagation: false,
|
|
@@ -3947,31 +3947,31 @@ var NgwMap = (function (exports) {
|
|
|
3947
3947
|
});
|
|
3948
3948
|
let CheckProperty = _CheckProperty;
|
|
3949
3949
|
|
|
3950
|
-
var __defProp$
|
|
3951
|
-
var __getOwnPropSymbols$
|
|
3952
|
-
var __hasOwnProp$
|
|
3953
|
-
var __propIsEnum$
|
|
3954
|
-
var __defNormalProp$
|
|
3955
|
-
var __spreadValues$
|
|
3950
|
+
var __defProp$u = Object.defineProperty;
|
|
3951
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
3952
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
3953
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
3954
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3955
|
+
var __spreadValues$l = (a, b) => {
|
|
3956
3956
|
for (var prop in b || (b = {}))
|
|
3957
|
-
if (__hasOwnProp$
|
|
3958
|
-
__defNormalProp$
|
|
3959
|
-
if (__getOwnPropSymbols$
|
|
3960
|
-
for (var prop of __getOwnPropSymbols$
|
|
3961
|
-
if (__propIsEnum$
|
|
3962
|
-
__defNormalProp$
|
|
3957
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
3958
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
3959
|
+
if (__getOwnPropSymbols$m)
|
|
3960
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
3961
|
+
if (__propIsEnum$m.call(b, prop))
|
|
3962
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
3963
3963
|
}
|
|
3964
3964
|
return a;
|
|
3965
3965
|
};
|
|
3966
|
-
var __publicField$
|
|
3966
|
+
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3967
3967
|
const BOOLEAN_TYPE = "boolean";
|
|
3968
3968
|
const STRING_TYPE = "string";
|
|
3969
3969
|
const _ItemProperties = class _ItemProperties {
|
|
3970
3970
|
constructor(item, propertiesList) {
|
|
3971
3971
|
this.item = item;
|
|
3972
|
-
__publicField$
|
|
3973
|
-
__publicField$
|
|
3974
|
-
__publicField$
|
|
3972
|
+
__publicField$l(this, "options", {});
|
|
3973
|
+
__publicField$l(this, "_properties", {});
|
|
3974
|
+
__publicField$l(this, "_propertiesList", []);
|
|
3975
3975
|
if (propertiesList) {
|
|
3976
3976
|
propertiesList.forEach(this._setPropertyHandler.bind(this));
|
|
3977
3977
|
}
|
|
@@ -4011,7 +4011,7 @@ var NgwMap = (function (exports) {
|
|
|
4011
4011
|
_setPropertyHandler(propOpt) {
|
|
4012
4012
|
const Handler = this._getHandler(propOpt);
|
|
4013
4013
|
if (Handler && propOpt.name) {
|
|
4014
|
-
const options = __spreadValues$
|
|
4014
|
+
const options = __spreadValues$l({}, propOpt);
|
|
4015
4015
|
this._properties[propOpt.name] = new Handler(
|
|
4016
4016
|
propOpt.name,
|
|
4017
4017
|
this.item,
|
|
@@ -4034,7 +4034,7 @@ var NgwMap = (function (exports) {
|
|
|
4034
4034
|
return Handler;
|
|
4035
4035
|
}
|
|
4036
4036
|
};
|
|
4037
|
-
__publicField$
|
|
4037
|
+
__publicField$l(_ItemProperties, "handlers", {
|
|
4038
4038
|
CheckProperty
|
|
4039
4039
|
});
|
|
4040
4040
|
let ItemProperties = _ItemProperties;
|
|
@@ -4141,14 +4141,14 @@ var NgwMap = (function (exports) {
|
|
|
4141
4141
|
return true;
|
|
4142
4142
|
}
|
|
4143
4143
|
|
|
4144
|
-
var __defProp$
|
|
4145
|
-
var __defNormalProp$
|
|
4146
|
-
var __publicField$
|
|
4144
|
+
var __defProp$t = Object.defineProperty;
|
|
4145
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4146
|
+
var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4147
4147
|
class TreeHelper {
|
|
4148
4148
|
constructor(item) {
|
|
4149
|
-
__publicField$
|
|
4150
|
-
__publicField$
|
|
4151
|
-
__publicField$
|
|
4149
|
+
__publicField$k(this, "item");
|
|
4150
|
+
__publicField$k(this, "_children", []);
|
|
4151
|
+
__publicField$k(this, "_parent");
|
|
4152
4152
|
this.item = item;
|
|
4153
4153
|
}
|
|
4154
4154
|
setParent(parent) {
|
|
@@ -4211,32 +4211,32 @@ var NgwMap = (function (exports) {
|
|
|
4211
4211
|
}
|
|
4212
4212
|
}
|
|
4213
4213
|
|
|
4214
|
-
var __defProp$
|
|
4215
|
-
var __getOwnPropSymbols$
|
|
4216
|
-
var __hasOwnProp$
|
|
4217
|
-
var __propIsEnum$
|
|
4218
|
-
var __defNormalProp$
|
|
4219
|
-
var __spreadValues$
|
|
4214
|
+
var __defProp$s = Object.defineProperty;
|
|
4215
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
4216
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
4217
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
4218
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4219
|
+
var __spreadValues$k = (a, b) => {
|
|
4220
4220
|
for (var prop in b || (b = {}))
|
|
4221
|
-
if (__hasOwnProp$
|
|
4222
|
-
__defNormalProp$
|
|
4223
|
-
if (__getOwnPropSymbols$
|
|
4224
|
-
for (var prop of __getOwnPropSymbols$
|
|
4225
|
-
if (__propIsEnum$
|
|
4226
|
-
__defNormalProp$
|
|
4221
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
4222
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
4223
|
+
if (__getOwnPropSymbols$l)
|
|
4224
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
4225
|
+
if (__propIsEnum$l.call(b, prop))
|
|
4226
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
4227
4227
|
}
|
|
4228
4228
|
return a;
|
|
4229
4229
|
};
|
|
4230
|
-
var __publicField$
|
|
4230
|
+
var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4231
4231
|
let ID$1 = 0;
|
|
4232
4232
|
class Item {
|
|
4233
4233
|
constructor(options) {
|
|
4234
|
-
__publicField$
|
|
4235
|
-
__publicField$
|
|
4236
|
-
__publicField$
|
|
4237
|
-
__publicField$
|
|
4234
|
+
__publicField$j(this, "options", {});
|
|
4235
|
+
__publicField$j(this, "properties");
|
|
4236
|
+
__publicField$j(this, "tree");
|
|
4237
|
+
__publicField$j(this, "id", ID$1);
|
|
4238
4238
|
ID$1 += 1;
|
|
4239
|
-
this.options = __spreadValues$
|
|
4239
|
+
this.options = __spreadValues$k({}, options);
|
|
4240
4240
|
this.tree = new TreeHelper(this);
|
|
4241
4241
|
}
|
|
4242
4242
|
initProperties() {
|
|
@@ -4288,6 +4288,168 @@ var NgwMap = (function (exports) {
|
|
|
4288
4288
|
}
|
|
4289
4289
|
}
|
|
4290
4290
|
|
|
4291
|
+
function createLayerSymbolParam(resourceId, intervals) {
|
|
4292
|
+
return { [`symbols[${resourceId}]`]: intervals.join(",") || void 0 };
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
var __defProp$r = Object.defineProperty;
|
|
4296
|
+
var __defProps$c = Object.defineProperties;
|
|
4297
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
4298
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
4299
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
4300
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
4301
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4302
|
+
var __spreadValues$j = (a, b) => {
|
|
4303
|
+
for (var prop in b || (b = {}))
|
|
4304
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
4305
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4306
|
+
if (__getOwnPropSymbols$k)
|
|
4307
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
4308
|
+
if (__propIsEnum$k.call(b, prop))
|
|
4309
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4310
|
+
}
|
|
4311
|
+
return a;
|
|
4312
|
+
};
|
|
4313
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
4314
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4315
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
4316
|
+
return new Promise((resolve, reject) => {
|
|
4317
|
+
var fulfilled = (value) => {
|
|
4318
|
+
try {
|
|
4319
|
+
step(generator.next(value));
|
|
4320
|
+
} catch (e) {
|
|
4321
|
+
reject(e);
|
|
4322
|
+
}
|
|
4323
|
+
};
|
|
4324
|
+
var rejected = (value) => {
|
|
4325
|
+
try {
|
|
4326
|
+
step(generator.throw(value));
|
|
4327
|
+
} catch (e) {
|
|
4328
|
+
reject(e);
|
|
4329
|
+
}
|
|
4330
|
+
};
|
|
4331
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
4332
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
4333
|
+
});
|
|
4334
|
+
};
|
|
4335
|
+
class Legend {
|
|
4336
|
+
constructor({
|
|
4337
|
+
legendSymbols,
|
|
4338
|
+
resourceId,
|
|
4339
|
+
connector,
|
|
4340
|
+
layerId,
|
|
4341
|
+
legend,
|
|
4342
|
+
webMap,
|
|
4343
|
+
layer,
|
|
4344
|
+
onSymbolRenderChange
|
|
4345
|
+
}) {
|
|
4346
|
+
__publicField$i(this, "layerId");
|
|
4347
|
+
__publicField$i(this, "layer");
|
|
4348
|
+
__publicField$i(this, "resourceId");
|
|
4349
|
+
__publicField$i(this, "legendSymbols", "expand");
|
|
4350
|
+
__publicField$i(this, "legend");
|
|
4351
|
+
// private blocked: boolean = false;
|
|
4352
|
+
__publicField$i(this, "layerVisibility", true);
|
|
4353
|
+
// private symbolRenderIndexes?: number[];
|
|
4354
|
+
__publicField$i(this, "onSymbolRenderChange");
|
|
4355
|
+
__publicField$i(this, "webMap");
|
|
4356
|
+
__publicField$i(this, "connector");
|
|
4357
|
+
if (legendSymbols) {
|
|
4358
|
+
this.legendSymbols = legendSymbols;
|
|
4359
|
+
}
|
|
4360
|
+
this.connector = connector;
|
|
4361
|
+
this.layer = layer;
|
|
4362
|
+
this.layerId = layerId;
|
|
4363
|
+
if (legend) {
|
|
4364
|
+
this.legend = this.createLegend(legend);
|
|
4365
|
+
}
|
|
4366
|
+
this.resourceId = resourceId;
|
|
4367
|
+
this.webMap = webMap;
|
|
4368
|
+
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
4369
|
+
}
|
|
4370
|
+
attachLayer(layer) {
|
|
4371
|
+
this.layerId = String(layer.id);
|
|
4372
|
+
this.layer = layer;
|
|
4373
|
+
}
|
|
4374
|
+
create() {
|
|
4375
|
+
return __async$k(this, arguments, function* (options = {}) {
|
|
4376
|
+
if (this.connector) {
|
|
4377
|
+
const ngwLegend = yield this.connector.route("render.legend_symbols", {
|
|
4378
|
+
id: this.resourceId
|
|
4379
|
+
}).get(__spreadValues$j({}, options));
|
|
4380
|
+
this.legend = ngwLegend;
|
|
4381
|
+
return this.createLegend(ngwLegend);
|
|
4382
|
+
}
|
|
4383
|
+
});
|
|
4384
|
+
}
|
|
4385
|
+
createLegend(items) {
|
|
4386
|
+
return items.map((params) => __spreadProps$c(__spreadValues$j({}, params), {
|
|
4387
|
+
/** @deprecated use display_name instead */
|
|
4388
|
+
name: params.display_name,
|
|
4389
|
+
/** @deprecated use icon instead */
|
|
4390
|
+
symbol: params.icon
|
|
4391
|
+
}));
|
|
4392
|
+
}
|
|
4393
|
+
setSymbolRender(symbolIndex, status) {
|
|
4394
|
+
if (this.legend) {
|
|
4395
|
+
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
4396
|
+
if (legendItem) {
|
|
4397
|
+
const render = legendItem.render;
|
|
4398
|
+
if (render !== status) {
|
|
4399
|
+
legendItem.render = status;
|
|
4400
|
+
const newSymbols = this.legend.filter((l) => l.render).map((l) => l.index);
|
|
4401
|
+
this.setLegendSymbol(newSymbols);
|
|
4402
|
+
if (this.onSymbolRenderChange) {
|
|
4403
|
+
this.onSymbolRenderChange(newSymbols);
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
}
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
setLegendSymbol(symbolRenderIndexes) {
|
|
4410
|
+
const intervals = this._consolidateIntervals(symbolRenderIndexes);
|
|
4411
|
+
if (!intervals.length) {
|
|
4412
|
+
this._hideLayer();
|
|
4413
|
+
}
|
|
4414
|
+
if (this.layer.updateLayer) {
|
|
4415
|
+
this.layer.updateLayer({
|
|
4416
|
+
params: __spreadValues$j({}, createLayerSymbolParam(this.resourceId, intervals))
|
|
4417
|
+
});
|
|
4418
|
+
}
|
|
4419
|
+
if (intervals.length) {
|
|
4420
|
+
this._showLayer();
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
_hideLayer() {
|
|
4424
|
+
if (this.layer.options.id) {
|
|
4425
|
+
this.webMap.mapAdapter.hideLayer(this.layer.layer);
|
|
4426
|
+
}
|
|
4427
|
+
}
|
|
4428
|
+
_showLayer() {
|
|
4429
|
+
if (this.layer.options.id) {
|
|
4430
|
+
if (this.layerVisibility) {
|
|
4431
|
+
this.webMap.showLayer(this.layer.options.id, { silent: true });
|
|
4432
|
+
}
|
|
4433
|
+
}
|
|
4434
|
+
}
|
|
4435
|
+
_consolidateIntervals(symbols) {
|
|
4436
|
+
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
4437
|
+
const intervals = [];
|
|
4438
|
+
let start = sortedSymbols[0];
|
|
4439
|
+
let end = start;
|
|
4440
|
+
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
4441
|
+
if (sortedSymbols[i] === end + 1) {
|
|
4442
|
+
end = sortedSymbols[i];
|
|
4443
|
+
} else {
|
|
4444
|
+
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
4445
|
+
start = sortedSymbols[i];
|
|
4446
|
+
end = start;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
return intervals;
|
|
4450
|
+
}
|
|
4451
|
+
}
|
|
4452
|
+
|
|
4291
4453
|
var __defProp$q = Object.defineProperty;
|
|
4292
4454
|
var __defProps$b = Object.defineProperties;
|
|
4293
4455
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
@@ -4329,14 +4491,23 @@ var NgwMap = (function (exports) {
|
|
|
4329
4491
|
});
|
|
4330
4492
|
};
|
|
4331
4493
|
const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
4332
|
-
constructor(
|
|
4494
|
+
constructor({
|
|
4495
|
+
webMap,
|
|
4496
|
+
item,
|
|
4497
|
+
options,
|
|
4498
|
+
connector,
|
|
4499
|
+
parent,
|
|
4500
|
+
noInit
|
|
4501
|
+
}) {
|
|
4333
4502
|
super(__spreadValues$i(__spreadValues$i({}, _NgwWebmapItem.options), options));
|
|
4334
|
-
this.webMap = webMap;
|
|
4335
4503
|
__publicField$h(this, "item");
|
|
4504
|
+
__publicField$h(this, "webMap");
|
|
4336
4505
|
__publicField$h(this, "connector");
|
|
4337
4506
|
__publicField$h(this, "layer");
|
|
4507
|
+
__publicField$h(this, "legend");
|
|
4338
4508
|
__publicField$h(this, "emitter", new EventEmitter());
|
|
4339
4509
|
__publicField$h(this, "_rootDescendantsCount", 0);
|
|
4510
|
+
this.webMap = webMap;
|
|
4340
4511
|
if (connector) {
|
|
4341
4512
|
this.connector = connector;
|
|
4342
4513
|
}
|
|
@@ -4359,14 +4530,14 @@ var NgwMap = (function (exports) {
|
|
|
4359
4530
|
}
|
|
4360
4531
|
static create(webMap, item, options, connector, parent) {
|
|
4361
4532
|
return __async$j(this, null, function* () {
|
|
4362
|
-
const ngwWebmapItem = new _NgwWebmapItem(
|
|
4533
|
+
const ngwWebmapItem = new _NgwWebmapItem({
|
|
4363
4534
|
webMap,
|
|
4364
4535
|
item,
|
|
4365
4536
|
options,
|
|
4366
4537
|
connector,
|
|
4367
4538
|
parent,
|
|
4368
|
-
true
|
|
4369
|
-
);
|
|
4539
|
+
noInit: true
|
|
4540
|
+
});
|
|
4370
4541
|
yield ngwWebmapItem._init(item);
|
|
4371
4542
|
return ngwWebmapItem;
|
|
4372
4543
|
});
|
|
@@ -4388,22 +4559,34 @@ var NgwMap = (function (exports) {
|
|
|
4388
4559
|
}
|
|
4389
4560
|
getLegend(options) {
|
|
4390
4561
|
return __async$j(this, null, function* () {
|
|
4391
|
-
var _a;
|
|
4562
|
+
var _a, _b;
|
|
4392
4563
|
const id = (_a = this.layer) == null ? void 0 : _a.id;
|
|
4393
4564
|
if (id !== void 0) {
|
|
4394
4565
|
const connector = this.connector;
|
|
4395
4566
|
if (connector && "resourceId" in this.item) {
|
|
4396
|
-
const
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4567
|
+
const resourceId = Number(this.item.resourceId);
|
|
4568
|
+
if (this.item.item_type === "layer") {
|
|
4569
|
+
if (this.layer) {
|
|
4570
|
+
const legend = new Legend({
|
|
4571
|
+
connector: this.connector,
|
|
4572
|
+
layerId: id,
|
|
4573
|
+
layer: this.layer,
|
|
4574
|
+
resourceId,
|
|
4575
|
+
webMap: this.webMap,
|
|
4576
|
+
legendSymbols: (_b = this.item.legend_symbols) != null ? _b : void 0,
|
|
4577
|
+
onSymbolRenderChange: (indexes) => {
|
|
4578
|
+
this.webMap.emitter.emit("event-symbol-render:change", {
|
|
4579
|
+
layerId: id,
|
|
4580
|
+
resourceId,
|
|
4581
|
+
indexes
|
|
4582
|
+
});
|
|
4583
|
+
}
|
|
4584
|
+
});
|
|
4585
|
+
yield legend.create(options);
|
|
4586
|
+
return [legend];
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
return [];
|
|
4407
4590
|
}
|
|
4408
4591
|
}
|
|
4409
4592
|
return [];
|
|
@@ -4458,13 +4641,13 @@ var NgwMap = (function (exports) {
|
|
|
4458
4641
|
if (group.children && group.children.length) {
|
|
4459
4642
|
const children = this.getChildren(group);
|
|
4460
4643
|
for (const child of children) {
|
|
4461
|
-
const childItem = new this.constructor(
|
|
4462
|
-
this.webMap,
|
|
4463
|
-
child,
|
|
4464
|
-
this.options,
|
|
4465
|
-
this.connector,
|
|
4466
|
-
this
|
|
4467
|
-
);
|
|
4644
|
+
const childItem = new this.constructor({
|
|
4645
|
+
webMap: this.webMap,
|
|
4646
|
+
item: child,
|
|
4647
|
+
options: this.options,
|
|
4648
|
+
connector: this.connector,
|
|
4649
|
+
parent: this
|
|
4650
|
+
});
|
|
4468
4651
|
this.tree.addChild(childItem);
|
|
4469
4652
|
}
|
|
4470
4653
|
}
|
|
@@ -4492,6 +4675,15 @@ var NgwMap = (function (exports) {
|
|
|
4492
4675
|
}
|
|
4493
4676
|
if (adapter) {
|
|
4494
4677
|
return this.webMap.addLayer(adapter, options).then((newLayer) => {
|
|
4678
|
+
this.webMap.emitter.on("layer:toggle", (e) => {
|
|
4679
|
+
if (e.id === newLayer.id) {
|
|
4680
|
+
const enabled = this.properties.get("visibility");
|
|
4681
|
+
const mapVisible = this.webMap.isLayerVisible(newLayer);
|
|
4682
|
+
if (enabled !== mapVisible) {
|
|
4683
|
+
this.properties.set("visibility", mapVisible);
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
});
|
|
4495
4687
|
setNewLayer(newLayer);
|
|
4496
4688
|
});
|
|
4497
4689
|
}
|
|
@@ -4794,12 +4986,12 @@ var NgwMap = (function (exports) {
|
|
|
4794
4986
|
headers,
|
|
4795
4987
|
drawOrderEnabled: (_a = webmap.draw_order_enabled) != null ? _a : false
|
|
4796
4988
|
});
|
|
4797
|
-
const layer = new this.NgwWebmapItem(
|
|
4798
|
-
this.options.webMap,
|
|
4799
|
-
webmap.root_item,
|
|
4989
|
+
const layer = new this.NgwWebmapItem({
|
|
4990
|
+
webMap: this.options.webMap,
|
|
4991
|
+
item: webmap.root_item,
|
|
4800
4992
|
options,
|
|
4801
4993
|
connector
|
|
4802
|
-
);
|
|
4994
|
+
});
|
|
4803
4995
|
layer.emitter.on("init", () => {
|
|
4804
4996
|
resolve(layer);
|
|
4805
4997
|
});
|
|
@@ -4865,6 +5057,7 @@ var NgwMap = (function (exports) {
|
|
|
4865
5057
|
}
|
|
4866
5058
|
}
|
|
4867
5059
|
_updateItemsParams(item, webMap, data) {
|
|
5060
|
+
var _a;
|
|
4868
5061
|
if (item) {
|
|
4869
5062
|
if (item.item_type === "group" || item.item_type === "root") {
|
|
4870
5063
|
if ("children" in item && item.children) {
|
|
@@ -4897,6 +5090,9 @@ var NgwMap = (function (exports) {
|
|
|
4897
5090
|
item = __spreadValues$h(__spreadValues$h({}, layerItem), layerAdapterOptions);
|
|
4898
5091
|
}
|
|
4899
5092
|
}
|
|
5093
|
+
if (typeof ((_a = this.options.nativeOptions) == null ? void 0 : _a.beforeItemCreated) === "function") {
|
|
5094
|
+
item = this.options.nativeOptions.beforeItemCreated(item);
|
|
5095
|
+
}
|
|
4900
5096
|
return item;
|
|
4901
5097
|
}
|
|
4902
5098
|
}
|
|
@@ -5782,42 +5978,6 @@ var NgwMap = (function (exports) {
|
|
|
5782
5978
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5783
5979
|
});
|
|
5784
5980
|
};
|
|
5785
|
-
class Legend {
|
|
5786
|
-
constructor({
|
|
5787
|
-
layerId,
|
|
5788
|
-
legend,
|
|
5789
|
-
onSymbolRenderChange
|
|
5790
|
-
}) {
|
|
5791
|
-
__publicField$c(this, "layerId");
|
|
5792
|
-
__publicField$c(this, "legend");
|
|
5793
|
-
__publicField$c(this, "onSymbolRenderChange");
|
|
5794
|
-
this.layerId = layerId;
|
|
5795
|
-
this.legend = this.createLegend(legend);
|
|
5796
|
-
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
5797
|
-
}
|
|
5798
|
-
createLegend(items) {
|
|
5799
|
-
return items.map((params) => __spreadProps$6(__spreadValues$b({}, params), {
|
|
5800
|
-
/** @deprecated use display_name instead */
|
|
5801
|
-
name: params.display_name,
|
|
5802
|
-
/** @deprecated use icon instead */
|
|
5803
|
-
symbol: params.icon
|
|
5804
|
-
}));
|
|
5805
|
-
}
|
|
5806
|
-
setSymbolRender(symbolIndex, status) {
|
|
5807
|
-
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
5808
|
-
if (legendItem) {
|
|
5809
|
-
const render = legendItem.render;
|
|
5810
|
-
if (render !== status) {
|
|
5811
|
-
legendItem.render = status;
|
|
5812
|
-
if (this.onSymbolRenderChange) {
|
|
5813
|
-
this.onSymbolRenderChange(
|
|
5814
|
-
this.legend.filter((l) => l.render).map((l) => l.index)
|
|
5815
|
-
);
|
|
5816
|
-
}
|
|
5817
|
-
}
|
|
5818
|
-
}
|
|
5819
|
-
}
|
|
5820
|
-
}
|
|
5821
5981
|
function createRasterAdapter(_0) {
|
|
5822
5982
|
return __async$c(this, arguments, function* ({
|
|
5823
5983
|
layerOptions,
|
|
@@ -5853,8 +6013,8 @@ var NgwMap = (function (exports) {
|
|
|
5853
6013
|
this.map = map;
|
|
5854
6014
|
__publicField$c(this, "item", item);
|
|
5855
6015
|
__publicField$c(this, "resourceId", resourceId);
|
|
5856
|
-
__publicField$c(this, "
|
|
5857
|
-
__publicField$c(this, "
|
|
6016
|
+
__publicField$c(this, "blocked", false);
|
|
6017
|
+
__publicField$c(this, "layerVisibility");
|
|
5858
6018
|
const opt = ngwApiToAdapterOptions({
|
|
5859
6019
|
options: layerOptions,
|
|
5860
6020
|
webMap,
|
|
@@ -5875,24 +6035,6 @@ var NgwMap = (function (exports) {
|
|
|
5875
6035
|
addLayer(addOptions) {
|
|
5876
6036
|
return super.addLayer(__spreadValues$b(__spreadValues$b({}, this.options), addOptions));
|
|
5877
6037
|
}
|
|
5878
|
-
showLayer() {
|
|
5879
|
-
this._layerVisibility = true;
|
|
5880
|
-
if (!this._blocked) {
|
|
5881
|
-
if (super.showLayer) {
|
|
5882
|
-
super.showLayer(this.layer);
|
|
5883
|
-
} else if (this.layer) {
|
|
5884
|
-
webMap.mapAdapter.showLayer(this.layer);
|
|
5885
|
-
}
|
|
5886
|
-
}
|
|
5887
|
-
}
|
|
5888
|
-
hideLayer() {
|
|
5889
|
-
this._layerVisibility = false;
|
|
5890
|
-
if (super.hideLayer) {
|
|
5891
|
-
super.hideLayer(this.layer);
|
|
5892
|
-
} else if (this.layer) {
|
|
5893
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5894
|
-
}
|
|
5895
|
-
}
|
|
5896
6038
|
getIdentificationIds() {
|
|
5897
6039
|
return __async$c(this, null, function* () {
|
|
5898
6040
|
if (this.item) {
|
|
@@ -5918,59 +6060,16 @@ var NgwMap = (function (exports) {
|
|
|
5918
6060
|
}, options));
|
|
5919
6061
|
const legend = new Legend({
|
|
5920
6062
|
layerId: id,
|
|
5921
|
-
|
|
5922
|
-
|
|
6063
|
+
layer: this,
|
|
6064
|
+
resourceId,
|
|
6065
|
+
webMap,
|
|
6066
|
+
legend: ngwLegend
|
|
5923
6067
|
});
|
|
5924
6068
|
return [legend];
|
|
5925
6069
|
}
|
|
5926
6070
|
return [];
|
|
5927
6071
|
});
|
|
5928
6072
|
}
|
|
5929
|
-
_hideLayer() {
|
|
5930
|
-
if (this.options.id) {
|
|
5931
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5932
|
-
}
|
|
5933
|
-
}
|
|
5934
|
-
_showLayer() {
|
|
5935
|
-
if (this.options.id) {
|
|
5936
|
-
if (this._layerVisibility) {
|
|
5937
|
-
webMap.showLayer(this.options.id, { silent: true });
|
|
5938
|
-
}
|
|
5939
|
-
}
|
|
5940
|
-
}
|
|
5941
|
-
_setLegendSymbol(renderIndexes) {
|
|
5942
|
-
const intervals = this._consolidateIntervals(renderIndexes);
|
|
5943
|
-
if (!intervals.length) {
|
|
5944
|
-
this._hideLayer();
|
|
5945
|
-
this._blocked = true;
|
|
5946
|
-
} else {
|
|
5947
|
-
this._blocked = false;
|
|
5948
|
-
this._showLayer();
|
|
5949
|
-
}
|
|
5950
|
-
if (this.updateLayer) {
|
|
5951
|
-
this.updateLayer({
|
|
5952
|
-
params: {
|
|
5953
|
-
[`symbols[${resourceId}]`]: intervals.join(",") || void 0
|
|
5954
|
-
}
|
|
5955
|
-
});
|
|
5956
|
-
}
|
|
5957
|
-
}
|
|
5958
|
-
_consolidateIntervals(symbols) {
|
|
5959
|
-
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
5960
|
-
const intervals = [];
|
|
5961
|
-
let start = sortedSymbols[0];
|
|
5962
|
-
let end = start;
|
|
5963
|
-
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
5964
|
-
if (sortedSymbols[i] === end + 1) {
|
|
5965
|
-
end = sortedSymbols[i];
|
|
5966
|
-
} else {
|
|
5967
|
-
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
5968
|
-
start = sortedSymbols[i];
|
|
5969
|
-
end = start;
|
|
5970
|
-
}
|
|
5971
|
-
}
|
|
5972
|
-
return intervals;
|
|
5973
|
-
}
|
|
5974
6073
|
};
|
|
5975
6074
|
} else {
|
|
5976
6075
|
throw new Error(adapter + " not supported yet. Only TILE");
|
|
@@ -6332,16 +6431,25 @@ var NgwMap = (function (exports) {
|
|
|
6332
6431
|
});
|
|
6333
6432
|
}
|
|
6334
6433
|
resource(opt) {
|
|
6434
|
+
return __async$9(this, null, function* () {
|
|
6435
|
+
const composite = yield this.composite(opt);
|
|
6436
|
+
return composite.feature_layer;
|
|
6437
|
+
});
|
|
6438
|
+
}
|
|
6439
|
+
composite(opt) {
|
|
6335
6440
|
return __async$9(this, null, function* () {
|
|
6336
6441
|
if (this._resource && this._resource.feature_layer) {
|
|
6337
|
-
return this._resource
|
|
6442
|
+
return this._resource;
|
|
6338
6443
|
}
|
|
6339
6444
|
const resp = yield this.connector.getResource(this.layerId, opt);
|
|
6340
|
-
if (!
|
|
6341
|
-
throw new Error("Resource
|
|
6445
|
+
if (!resp) {
|
|
6446
|
+
throw new Error("Resource does not exist");
|
|
6447
|
+
}
|
|
6448
|
+
if (!resp.feature_layer) {
|
|
6449
|
+
throw new Error("Resource is not a vector layer");
|
|
6342
6450
|
}
|
|
6343
6451
|
this._resource = resp;
|
|
6344
|
-
return resp
|
|
6452
|
+
return resp;
|
|
6345
6453
|
});
|
|
6346
6454
|
}
|
|
6347
6455
|
getBounds(opt) {
|
|
@@ -6354,7 +6462,7 @@ var NgwMap = (function (exports) {
|
|
|
6354
6462
|
resourceId: this.layerId
|
|
6355
6463
|
}, opt));
|
|
6356
6464
|
}
|
|
6357
|
-
geojson(options) {
|
|
6465
|
+
geojson(options = {}) {
|
|
6358
6466
|
if (this._geojson) {
|
|
6359
6467
|
return Promise.resolve(this._geojson);
|
|
6360
6468
|
}
|
|
@@ -10207,7 +10315,8 @@ var NgwMap = (function (exports) {
|
|
|
10207
10315
|
const identFunc = typeof layer.getIdentificationIds === "function" ? layer.getIdentificationIds : false;
|
|
10208
10316
|
const interactive = (_a = layer.options.interactive) != null ? _a : true;
|
|
10209
10317
|
if (identFunc && layer.options.selectable && interactive && this.isLayerVisible(layer)) {
|
|
10210
|
-
|
|
10318
|
+
const layerIds = identFunc.call(layer);
|
|
10319
|
+
promises.push(layerIds);
|
|
10211
10320
|
}
|
|
10212
10321
|
}
|
|
10213
10322
|
const getIdsPromise = Promise.all(promises);
|