@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
|
@@ -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
|
const svgPath = {
|
|
3
3
|
brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
|
|
4
4
|
circle: '<circle cx="6" cy="6" r="6"/>',
|
|
@@ -365,23 +365,23 @@ function template(str, data) {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
var __defProp$
|
|
369
|
-
var __getOwnPropSymbols$
|
|
370
|
-
var __hasOwnProp$
|
|
371
|
-
var __propIsEnum$
|
|
372
|
-
var __defNormalProp$
|
|
373
|
-
var __spreadValues$
|
|
368
|
+
var __defProp$R = Object.defineProperty;
|
|
369
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
370
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
371
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
372
|
+
var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
373
|
+
var __spreadValues$y = (a, b) => {
|
|
374
374
|
for (var prop in b || (b = {}))
|
|
375
|
-
if (__hasOwnProp$
|
|
376
|
-
__defNormalProp$
|
|
377
|
-
if (__getOwnPropSymbols$
|
|
378
|
-
for (var prop of __getOwnPropSymbols$
|
|
379
|
-
if (__propIsEnum$
|
|
380
|
-
__defNormalProp$
|
|
375
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
376
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
377
|
+
if (__getOwnPropSymbols$z)
|
|
378
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
379
|
+
if (__propIsEnum$z.call(b, prop))
|
|
380
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
381
381
|
}
|
|
382
382
|
return a;
|
|
383
383
|
};
|
|
384
|
-
var __async$
|
|
384
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
385
385
|
return new Promise((resolve, reject) => {
|
|
386
386
|
var fulfilled = (value) => {
|
|
387
387
|
try {
|
|
@@ -402,7 +402,7 @@ var __async$v = (__this, __arguments, generator) => {
|
|
|
402
402
|
});
|
|
403
403
|
};
|
|
404
404
|
function apiRequest(opt) {
|
|
405
|
-
return __async$
|
|
405
|
+
return __async$w(this, null, function* () {
|
|
406
406
|
const { params, name, connector, requestOptions } = opt;
|
|
407
407
|
const apiItems = yield connector.connect();
|
|
408
408
|
let apiItem = apiItems && apiItems[name];
|
|
@@ -440,7 +440,7 @@ function apiRequest(opt) {
|
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
if (url) {
|
|
443
|
-
return connector.makeQuery(url, params, __spreadValues$
|
|
443
|
+
return connector.makeQuery(url, params, __spreadValues$y({
|
|
444
444
|
cacheName: name
|
|
445
445
|
}, requestOptions));
|
|
446
446
|
} else {
|
|
@@ -452,12 +452,12 @@ function apiRequest(opt) {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
var __defProp$
|
|
456
|
-
var __defNormalProp$
|
|
457
|
-
var __publicField$
|
|
455
|
+
var __defProp$Q = Object.defineProperty;
|
|
456
|
+
var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
457
|
+
var __publicField$A = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
458
458
|
const _Cache = class _Cache {
|
|
459
459
|
constructor(options = {}) {
|
|
460
|
-
__publicField$
|
|
460
|
+
__publicField$A(this, "cache", []);
|
|
461
461
|
var _a;
|
|
462
462
|
const namespace = (_a = options.namespace) != null ? _a : "default";
|
|
463
463
|
if (_Cache.instance[namespace]) {
|
|
@@ -588,7 +588,7 @@ const _Cache = class _Cache {
|
|
|
588
588
|
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
|
-
__publicField$
|
|
591
|
+
__publicField$A(_Cache, "instance", {});
|
|
592
592
|
let Cache = _Cache;
|
|
593
593
|
|
|
594
594
|
var domain;
|
|
@@ -1065,7 +1065,7 @@ function unwrapListeners(arr) {
|
|
|
1065
1065
|
|
|
1066
1066
|
var pkg = {
|
|
1067
1067
|
name: "@nextgis/ngw-connector",
|
|
1068
|
-
version: "3.0.0-alpha.
|
|
1068
|
+
version: "3.0.0-alpha.18",
|
|
1069
1069
|
_priority: 12,
|
|
1070
1070
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
1071
1071
|
main: "index.js",
|
|
@@ -1074,15 +1074,15 @@ var pkg = {
|
|
|
1074
1074
|
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
1075
1075
|
types: "lib/index.d.ts",
|
|
1076
1076
|
dependencies: {
|
|
1077
|
-
"@nextgis/cache": "^3.0.0-alpha.
|
|
1078
|
-
"@nextgis/cancelable-promise": "^3.0.0-alpha.
|
|
1079
|
-
"@nextgis/utils": "^3.0.0-alpha.
|
|
1077
|
+
"@nextgis/cache": "^3.0.0-alpha.17",
|
|
1078
|
+
"@nextgis/cancelable-promise": "^3.0.0-alpha.17",
|
|
1079
|
+
"@nextgis/utils": "^3.0.0-alpha.17",
|
|
1080
1080
|
"@types/events": "^3.0.0",
|
|
1081
1081
|
events: "*",
|
|
1082
1082
|
"form-data": "^4.0.0"
|
|
1083
1083
|
},
|
|
1084
1084
|
devDependencies: {
|
|
1085
|
-
"@nextgis/build-tools": "^3.0.0-alpha.
|
|
1085
|
+
"@nextgis/build-tools": "^3.0.0-alpha.17"
|
|
1086
1086
|
},
|
|
1087
1087
|
scripts: {
|
|
1088
1088
|
clean: "rimraf ./lib",
|
|
@@ -1129,46 +1129,46 @@ class AbortError extends Error {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
1131
|
|
|
1132
|
-
var __defProp$
|
|
1133
|
-
var __defNormalProp$
|
|
1134
|
-
var __publicField$
|
|
1132
|
+
var __defProp$P = Object.defineProperty;
|
|
1133
|
+
var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1134
|
+
var __publicField$z = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1135
1135
|
class NgwError extends Error {
|
|
1136
1136
|
constructor(er) {
|
|
1137
1137
|
super();
|
|
1138
|
-
__publicField$
|
|
1139
|
-
__publicField$
|
|
1140
|
-
__publicField$
|
|
1141
|
-
__publicField$
|
|
1142
|
-
__publicField$
|
|
1143
|
-
__publicField$
|
|
1144
|
-
__publicField$
|
|
1145
|
-
__publicField$
|
|
1138
|
+
__publicField$z(this, "name", "NgwError");
|
|
1139
|
+
__publicField$z(this, "title");
|
|
1140
|
+
__publicField$z(this, "message");
|
|
1141
|
+
__publicField$z(this, "detail");
|
|
1142
|
+
__publicField$z(this, "exception");
|
|
1143
|
+
__publicField$z(this, "status_code");
|
|
1144
|
+
__publicField$z(this, "data");
|
|
1145
|
+
__publicField$z(this, "guru_meditation");
|
|
1146
1146
|
Object.assign(this, er);
|
|
1147
1147
|
Object.setPrototypeOf(this, NgwError.prototype);
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
-
var __defProp$
|
|
1152
|
-
var __defNormalProp$
|
|
1153
|
-
var __publicField$
|
|
1151
|
+
var __defProp$O = Object.defineProperty;
|
|
1152
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1153
|
+
var __publicField$y = (obj, key, value) => __defNormalProp$O(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1154
1154
|
class InsufficientPermissionsError extends NgwError {
|
|
1155
1155
|
constructor(obj) {
|
|
1156
1156
|
super(obj);
|
|
1157
|
-
__publicField$
|
|
1158
|
-
__publicField$
|
|
1157
|
+
__publicField$y(this, "name", "InsufficientPermissionsError");
|
|
1158
|
+
__publicField$y(this, "exception", "nextgisweb.core.exception.InsufficientPermissions");
|
|
1159
1159
|
Object.setPrototypeOf(this, InsufficientPermissionsError.prototype);
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
|
-
var __defProp$
|
|
1164
|
-
var __defNormalProp$
|
|
1165
|
-
var __publicField$
|
|
1163
|
+
var __defProp$N = Object.defineProperty;
|
|
1164
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1165
|
+
var __publicField$x = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1166
1166
|
let NetworksResponseError$1 = class NetworksResponseError extends NgwError {
|
|
1167
1167
|
constructor(obj) {
|
|
1168
1168
|
super(obj);
|
|
1169
|
-
__publicField$
|
|
1170
|
-
__publicField$
|
|
1171
|
-
__publicField$
|
|
1169
|
+
__publicField$x(this, "message", "There is no response from the server or problem connecting to server.");
|
|
1170
|
+
__publicField$x(this, "title", "Network error");
|
|
1171
|
+
__publicField$x(this, "detail", "Check network connectivity and try again later.");
|
|
1172
1172
|
Object.setPrototypeOf(this, NetworksResponseError.prototype);
|
|
1173
1173
|
}
|
|
1174
1174
|
};
|
|
@@ -1205,27 +1205,27 @@ function isError(error) {
|
|
|
1205
1205
|
return false;
|
|
1206
1206
|
}
|
|
1207
1207
|
|
|
1208
|
-
var __defProp$
|
|
1209
|
-
var __defNormalProp$
|
|
1210
|
-
var __publicField$
|
|
1208
|
+
var __defProp$M = Object.defineProperty;
|
|
1209
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1210
|
+
var __publicField$w = (obj, key, value) => __defNormalProp$M(obj, key + "" , value);
|
|
1211
1211
|
class NetworkError extends Error {
|
|
1212
1212
|
constructor(url) {
|
|
1213
1213
|
super();
|
|
1214
|
-
__publicField$
|
|
1214
|
+
__publicField$w(this, "name", "NetworkError");
|
|
1215
1215
|
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
1216
1216
|
this.message = `Unable to request ${url}.
|
|
1217
1217
|
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
-
var __defProp$
|
|
1222
|
-
var __defNormalProp$
|
|
1223
|
-
var __publicField$
|
|
1221
|
+
var __defProp$L = Object.defineProperty;
|
|
1222
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1223
|
+
var __publicField$v = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1224
1224
|
class ResourceNotFoundError extends NgwError {
|
|
1225
1225
|
constructor(obj) {
|
|
1226
1226
|
super(obj);
|
|
1227
|
-
__publicField$
|
|
1228
|
-
__publicField$
|
|
1227
|
+
__publicField$v(this, "name", "ResourceNotFoundError");
|
|
1228
|
+
__publicField$v(this, "exception", "nextgisweb.resource.exception.ResourceNotFound");
|
|
1229
1229
|
Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
@@ -1242,13 +1242,13 @@ var errors = /*#__PURE__*/Object.freeze({
|
|
|
1242
1242
|
isError: isError
|
|
1243
1243
|
});
|
|
1244
1244
|
|
|
1245
|
-
var __defProp$
|
|
1246
|
-
var __defNormalProp$
|
|
1247
|
-
var __publicField$
|
|
1245
|
+
var __defProp$K = Object.defineProperty;
|
|
1246
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1247
|
+
var __publicField$u = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1248
1248
|
class BaseAPIError extends Error {
|
|
1249
1249
|
constructor(message) {
|
|
1250
1250
|
super(message || "Something went wrong.");
|
|
1251
|
-
__publicField$
|
|
1251
|
+
__publicField$u(this, "title");
|
|
1252
1252
|
this.name = "BaseAPIError";
|
|
1253
1253
|
this.title = "Unknown API error";
|
|
1254
1254
|
if (Error.captureStackTrace) {
|
|
@@ -1260,7 +1260,7 @@ class NetworksResponseError extends BaseAPIError {
|
|
|
1260
1260
|
// prettier-ignore
|
|
1261
1261
|
constructor(message) {
|
|
1262
1262
|
super(message || "There is no response from the server or problem connecting to server.");
|
|
1263
|
-
__publicField$
|
|
1263
|
+
__publicField$u(this, "detail");
|
|
1264
1264
|
this.title = "Network error";
|
|
1265
1265
|
this.detail = "Check network connectivity and try again later.";
|
|
1266
1266
|
}
|
|
@@ -1274,8 +1274,8 @@ class InvalidResponseError extends BaseAPIError {
|
|
|
1274
1274
|
class ServerResponseError extends BaseAPIError {
|
|
1275
1275
|
constructor(data) {
|
|
1276
1276
|
super(data.message);
|
|
1277
|
-
__publicField$
|
|
1278
|
-
__publicField$
|
|
1277
|
+
__publicField$u(this, "detail");
|
|
1278
|
+
__publicField$u(this, "data");
|
|
1279
1279
|
this.title = data.title || this.title;
|
|
1280
1280
|
this.detail = data.detail || null;
|
|
1281
1281
|
this.data = data;
|
|
@@ -1285,8 +1285,8 @@ class LunkwillError extends Error {
|
|
|
1285
1285
|
// prettier-ignore
|
|
1286
1286
|
constructor(message, data = {}) {
|
|
1287
1287
|
super(message || "Unexpected error while processing long-running request.");
|
|
1288
|
-
__publicField$
|
|
1289
|
-
__publicField$
|
|
1288
|
+
__publicField$u(this, "title");
|
|
1289
|
+
__publicField$u(this, "data");
|
|
1290
1290
|
this.name = "LunkwillError";
|
|
1291
1291
|
this.title = "Long-running request error";
|
|
1292
1292
|
this.data = data;
|
|
@@ -1306,35 +1306,35 @@ class LunkwillRequestFailed extends LunkwillError {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
1309
|
-
var __defProp$
|
|
1310
|
-
var __getOwnPropSymbols$
|
|
1311
|
-
var __hasOwnProp$
|
|
1312
|
-
var __propIsEnum$
|
|
1313
|
-
var __defNormalProp$
|
|
1314
|
-
var __spreadValues$
|
|
1309
|
+
var __defProp$J = Object.defineProperty;
|
|
1310
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
1311
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
1312
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
1313
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1314
|
+
var __spreadValues$x = (a, b) => {
|
|
1315
1315
|
for (var prop in b || (b = {}))
|
|
1316
|
-
if (__hasOwnProp$
|
|
1317
|
-
__defNormalProp$
|
|
1318
|
-
if (__getOwnPropSymbols$
|
|
1319
|
-
for (var prop of __getOwnPropSymbols$
|
|
1320
|
-
if (__propIsEnum$
|
|
1321
|
-
__defNormalProp$
|
|
1316
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
1317
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
1318
|
+
if (__getOwnPropSymbols$y)
|
|
1319
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
1320
|
+
if (__propIsEnum$y.call(b, prop))
|
|
1321
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
1322
1322
|
}
|
|
1323
1323
|
return a;
|
|
1324
1324
|
};
|
|
1325
1325
|
var __objRest$5 = (source, exclude) => {
|
|
1326
1326
|
var target = {};
|
|
1327
1327
|
for (var prop in source)
|
|
1328
|
-
if (__hasOwnProp$
|
|
1328
|
+
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1329
1329
|
target[prop] = source[prop];
|
|
1330
|
-
if (source != null && __getOwnPropSymbols$
|
|
1331
|
-
for (var prop of __getOwnPropSymbols$
|
|
1332
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1330
|
+
if (source != null && __getOwnPropSymbols$y)
|
|
1331
|
+
for (var prop of __getOwnPropSymbols$y(source)) {
|
|
1332
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
|
|
1333
1333
|
target[prop] = source[prop];
|
|
1334
1334
|
}
|
|
1335
1335
|
return target;
|
|
1336
1336
|
};
|
|
1337
|
-
var __async$
|
|
1337
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
1338
1338
|
return new Promise((resolve, reject) => {
|
|
1339
1339
|
var fulfilled = (value) => {
|
|
1340
1340
|
try {
|
|
@@ -1359,7 +1359,7 @@ function lunkwillCheckResponse(lwResp) {
|
|
|
1359
1359
|
return ct !== void 0 && ct !== null && ct.includes("application/vnd.lunkwill.request-summary+json");
|
|
1360
1360
|
}
|
|
1361
1361
|
function responseJson(response) {
|
|
1362
|
-
return __async$
|
|
1362
|
+
return __async$v(this, null, function* () {
|
|
1363
1363
|
try {
|
|
1364
1364
|
return response.json();
|
|
1365
1365
|
} catch (e) {
|
|
@@ -1368,7 +1368,7 @@ function responseJson(response) {
|
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
function lunkwillResponseUrl(lwResp) {
|
|
1371
|
-
return __async$
|
|
1371
|
+
return __async$v(this, null, function* () {
|
|
1372
1372
|
const lwData = yield responseJson(lwResp);
|
|
1373
1373
|
let delay = lwData.delay_ms;
|
|
1374
1374
|
const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
|
|
@@ -1412,7 +1412,7 @@ function lunkwillResponseUrl(lwResp) {
|
|
|
1412
1412
|
});
|
|
1413
1413
|
}
|
|
1414
1414
|
function lunkwillFetch(lwRespUrl) {
|
|
1415
|
-
return __async$
|
|
1415
|
+
return __async$v(this, null, function* () {
|
|
1416
1416
|
try {
|
|
1417
1417
|
return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
|
|
1418
1418
|
} catch (e) {
|
|
@@ -1460,14 +1460,14 @@ function generateUrl(path, query) {
|
|
|
1460
1460
|
return path + urlParams;
|
|
1461
1461
|
}
|
|
1462
1462
|
function request(path, options, cacheEngine) {
|
|
1463
|
-
return __async$
|
|
1463
|
+
return __async$v(this, null, function* () {
|
|
1464
1464
|
var _b, _c;
|
|
1465
1465
|
const defaults = {
|
|
1466
1466
|
method: "GET",
|
|
1467
1467
|
credentials: "same-origin",
|
|
1468
1468
|
headers: {}
|
|
1469
1469
|
};
|
|
1470
|
-
const _a = __spreadValues$
|
|
1470
|
+
const _a = __spreadValues$x(__spreadValues$x({}, defaults), options), {
|
|
1471
1471
|
withCredentials,
|
|
1472
1472
|
responseType,
|
|
1473
1473
|
cacheProps,
|
|
@@ -1504,7 +1504,7 @@ function request(path, options, cacheEngine) {
|
|
|
1504
1504
|
opt.headers = headers;
|
|
1505
1505
|
}
|
|
1506
1506
|
const url = generateUrl(path, query);
|
|
1507
|
-
const makeRequest = () => __async$
|
|
1507
|
+
const makeRequest = () => __async$v(this, null, function* () {
|
|
1508
1508
|
let response;
|
|
1509
1509
|
try {
|
|
1510
1510
|
response = yield fetch(url, opt);
|
|
@@ -1547,7 +1547,7 @@ function request(path, options, cacheEngine) {
|
|
|
1547
1547
|
if (cacheEngine) {
|
|
1548
1548
|
if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
|
|
1549
1549
|
if (cache !== false) {
|
|
1550
|
-
const props = cacheProps ? cacheProps : __spreadValues$
|
|
1550
|
+
const props = cacheProps ? cacheProps : __spreadValues$x({}, objectRemoveEmpty({
|
|
1551
1551
|
withCredentials,
|
|
1552
1552
|
responseType
|
|
1553
1553
|
}));
|
|
@@ -1567,38 +1567,38 @@ function request(path, options, cacheEngine) {
|
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
1570
|
-
var __defProp$
|
|
1571
|
-
var __defProps$
|
|
1572
|
-
var __getOwnPropDescs$
|
|
1573
|
-
var __getOwnPropSymbols$
|
|
1574
|
-
var __hasOwnProp$
|
|
1575
|
-
var __propIsEnum$
|
|
1576
|
-
var __defNormalProp$
|
|
1577
|
-
var __spreadValues$
|
|
1570
|
+
var __defProp$I = Object.defineProperty;
|
|
1571
|
+
var __defProps$j = Object.defineProperties;
|
|
1572
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
1573
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
1574
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
1575
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
1576
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1577
|
+
var __spreadValues$w = (a, b) => {
|
|
1578
1578
|
for (var prop in b || (b = {}))
|
|
1579
|
-
if (__hasOwnProp$
|
|
1580
|
-
__defNormalProp$
|
|
1581
|
-
if (__getOwnPropSymbols$
|
|
1582
|
-
for (var prop of __getOwnPropSymbols$
|
|
1583
|
-
if (__propIsEnum$
|
|
1584
|
-
__defNormalProp$
|
|
1579
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
1580
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
1581
|
+
if (__getOwnPropSymbols$x)
|
|
1582
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
1583
|
+
if (__propIsEnum$x.call(b, prop))
|
|
1584
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
1585
1585
|
}
|
|
1586
1586
|
return a;
|
|
1587
1587
|
};
|
|
1588
|
-
var __spreadProps$
|
|
1588
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
1589
1589
|
var __objRest$4 = (source, exclude) => {
|
|
1590
1590
|
var target = {};
|
|
1591
1591
|
for (var prop in source)
|
|
1592
|
-
if (__hasOwnProp$
|
|
1592
|
+
if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1593
1593
|
target[prop] = source[prop];
|
|
1594
|
-
if (source != null && __getOwnPropSymbols$
|
|
1595
|
-
for (var prop of __getOwnPropSymbols$
|
|
1596
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1594
|
+
if (source != null && __getOwnPropSymbols$x)
|
|
1595
|
+
for (var prop of __getOwnPropSymbols$x(source)) {
|
|
1596
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
|
|
1597
1597
|
target[prop] = source[prop];
|
|
1598
1598
|
}
|
|
1599
1599
|
return target;
|
|
1600
1600
|
};
|
|
1601
|
-
var __async$
|
|
1601
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
1602
1602
|
return new Promise((resolve, reject) => {
|
|
1603
1603
|
var fulfilled = (value) => {
|
|
1604
1604
|
try {
|
|
@@ -1649,7 +1649,7 @@ function routeURL(name, baseUrl, routeData, ...rest) {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
function route(name, connector, ...rest) {
|
|
1651
1651
|
const result = {
|
|
1652
|
-
url: (opt) => __async$
|
|
1652
|
+
url: (opt) => __async$u(this, null, function* () {
|
|
1653
1653
|
var _a;
|
|
1654
1654
|
const routeData = yield connector.connect();
|
|
1655
1655
|
const template = routeURL(
|
|
@@ -1677,10 +1677,10 @@ function route(name, connector, ...rest) {
|
|
|
1677
1677
|
routeData,
|
|
1678
1678
|
...rest
|
|
1679
1679
|
);
|
|
1680
|
-
const headers = objectRemoveEmpty(__spreadValues$
|
|
1680
|
+
const headers = objectRemoveEmpty(__spreadValues$w(__spreadValues$w({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
|
|
1681
1681
|
return request(
|
|
1682
1682
|
template,
|
|
1683
|
-
__spreadProps$
|
|
1683
|
+
__spreadProps$j(__spreadValues$w({
|
|
1684
1684
|
headers
|
|
1685
1685
|
}, restOpt), {
|
|
1686
1686
|
method
|
|
@@ -1804,39 +1804,39 @@ function removeConnector(connector) {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
1806
|
|
|
1807
|
-
var __defProp$
|
|
1808
|
-
var __defProps$
|
|
1809
|
-
var __getOwnPropDescs$
|
|
1810
|
-
var __getOwnPropSymbols$
|
|
1811
|
-
var __hasOwnProp$
|
|
1812
|
-
var __propIsEnum$
|
|
1813
|
-
var __defNormalProp$
|
|
1814
|
-
var __spreadValues$
|
|
1807
|
+
var __defProp$H = Object.defineProperty;
|
|
1808
|
+
var __defProps$i = Object.defineProperties;
|
|
1809
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
1810
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
1811
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
1812
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
1813
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1814
|
+
var __spreadValues$v = (a, b) => {
|
|
1815
1815
|
for (var prop in b || (b = {}))
|
|
1816
|
-
if (__hasOwnProp$
|
|
1817
|
-
__defNormalProp$
|
|
1818
|
-
if (__getOwnPropSymbols$
|
|
1819
|
-
for (var prop of __getOwnPropSymbols$
|
|
1820
|
-
if (__propIsEnum$
|
|
1821
|
-
__defNormalProp$
|
|
1816
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
1817
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
1818
|
+
if (__getOwnPropSymbols$w)
|
|
1819
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
1820
|
+
if (__propIsEnum$w.call(b, prop))
|
|
1821
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
1822
1822
|
}
|
|
1823
1823
|
return a;
|
|
1824
1824
|
};
|
|
1825
|
-
var __spreadProps$
|
|
1825
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
1826
1826
|
var __objRest$3 = (source, exclude) => {
|
|
1827
1827
|
var target = {};
|
|
1828
1828
|
for (var prop in source)
|
|
1829
|
-
if (__hasOwnProp$
|
|
1829
|
+
if (__hasOwnProp$w.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1830
1830
|
target[prop] = source[prop];
|
|
1831
|
-
if (source != null && __getOwnPropSymbols$
|
|
1832
|
-
for (var prop of __getOwnPropSymbols$
|
|
1833
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1831
|
+
if (source != null && __getOwnPropSymbols$w)
|
|
1832
|
+
for (var prop of __getOwnPropSymbols$w(source)) {
|
|
1833
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$w.call(source, prop))
|
|
1834
1834
|
target[prop] = source[prop];
|
|
1835
1835
|
}
|
|
1836
1836
|
return target;
|
|
1837
1837
|
};
|
|
1838
|
-
var __publicField$
|
|
1839
|
-
var __async$
|
|
1838
|
+
var __publicField$t = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1839
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
1840
1840
|
return new Promise((resolve, reject) => {
|
|
1841
1841
|
var fulfilled = (value) => {
|
|
1842
1842
|
try {
|
|
@@ -1861,18 +1861,18 @@ let REQUEST_ID = 0;
|
|
|
1861
1861
|
class NgwConnector {
|
|
1862
1862
|
constructor(options) {
|
|
1863
1863
|
this.options = options;
|
|
1864
|
-
__publicField$
|
|
1865
|
-
__publicField$
|
|
1866
|
-
__publicField$
|
|
1867
|
-
__publicField$
|
|
1868
|
-
__publicField$
|
|
1864
|
+
__publicField$t(this, "id", ID$2++);
|
|
1865
|
+
__publicField$t(this, "emitter", new EventEmitter());
|
|
1866
|
+
__publicField$t(this, "user");
|
|
1867
|
+
__publicField$t(this, "cache");
|
|
1868
|
+
__publicField$t(this, "withCredentials");
|
|
1869
1869
|
// Dedicated cache for route requests, as these are executed before any other requests.
|
|
1870
1870
|
// This cache does not need to be cleared during the session.
|
|
1871
|
-
__publicField$
|
|
1872
|
-
__publicField$
|
|
1873
|
-
__publicField$
|
|
1874
|
-
__publicField$
|
|
1875
|
-
__publicField$
|
|
1871
|
+
__publicField$t(this, "routeCache");
|
|
1872
|
+
__publicField$t(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
1873
|
+
__publicField$t(this, "routeStr", "/api/component/pyramid/route");
|
|
1874
|
+
__publicField$t(this, "activeRequests", {});
|
|
1875
|
+
__publicField$t(this, "requestTransform");
|
|
1876
1876
|
const exist = findConnector(options);
|
|
1877
1877
|
this.cache = new Cache({ namespace: options.cacheId });
|
|
1878
1878
|
this.routeCache = new Cache({ namespace: "routecache" });
|
|
@@ -1925,7 +1925,7 @@ class NgwConnector {
|
|
|
1925
1925
|
* ```
|
|
1926
1926
|
*/
|
|
1927
1927
|
connect() {
|
|
1928
|
-
return __async$
|
|
1928
|
+
return __async$t(this, arguments, function* ({
|
|
1929
1929
|
signal
|
|
1930
1930
|
} = {}) {
|
|
1931
1931
|
const auth = this.options.auth;
|
|
@@ -1964,14 +1964,14 @@ class NgwConnector {
|
|
|
1964
1964
|
this.emitter.emit("logout");
|
|
1965
1965
|
}
|
|
1966
1966
|
getUserInfo(credentials, options) {
|
|
1967
|
-
return __async$
|
|
1967
|
+
return __async$t(this, null, function* () {
|
|
1968
1968
|
if (this.user && this.user.id) {
|
|
1969
1969
|
return this.user;
|
|
1970
1970
|
}
|
|
1971
1971
|
if (credentials) {
|
|
1972
1972
|
this.options.auth = credentials;
|
|
1973
1973
|
}
|
|
1974
|
-
const options_ = __spreadValues$
|
|
1974
|
+
const options_ = __spreadValues$v({
|
|
1975
1975
|
headers: this.getAuthorizationHeaders(credentials),
|
|
1976
1976
|
cache: true
|
|
1977
1977
|
}, options);
|
|
@@ -2012,7 +2012,7 @@ class NgwConnector {
|
|
|
2012
2012
|
this.activeRequests = {};
|
|
2013
2013
|
}
|
|
2014
2014
|
getActiveApiRequests() {
|
|
2015
|
-
return __spreadValues$
|
|
2015
|
+
return __spreadValues$v({}, this.activeRequests);
|
|
2016
2016
|
}
|
|
2017
2017
|
route(name, ...rest) {
|
|
2018
2018
|
return route(name, this, ...rest);
|
|
@@ -2024,7 +2024,7 @@ class NgwConnector {
|
|
|
2024
2024
|
* @param options - Request options
|
|
2025
2025
|
*/
|
|
2026
2026
|
makeQuery(_0, _1) {
|
|
2027
|
-
return __async$
|
|
2027
|
+
return __async$t(this, arguments, function* (url, params, options = {}) {
|
|
2028
2028
|
var _b;
|
|
2029
2029
|
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
2030
2030
|
if (!url) {
|
|
@@ -2035,7 +2035,7 @@ class NgwConnector {
|
|
|
2035
2035
|
url = template(url, restParams);
|
|
2036
2036
|
}
|
|
2037
2037
|
url = encodeURI(fixUrlStr(url));
|
|
2038
|
-
options = __spreadValues$
|
|
2038
|
+
options = __spreadValues$v({ withCredentials: this.withCredentials }, options);
|
|
2039
2039
|
const {
|
|
2040
2040
|
cache,
|
|
2041
2041
|
signal: externalSignal,
|
|
@@ -2057,7 +2057,7 @@ class NgwConnector {
|
|
|
2057
2057
|
});
|
|
2058
2058
|
}
|
|
2059
2059
|
options.signal = internalSignal;
|
|
2060
|
-
const createPromise = () => __async$
|
|
2060
|
+
const createPromise = () => __async$t(this, null, function* () {
|
|
2061
2061
|
const id = REQUEST_ID++;
|
|
2062
2062
|
this.activeRequests[id] = internalAbortController;
|
|
2063
2063
|
try {
|
|
@@ -2067,7 +2067,7 @@ class NgwConnector {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
});
|
|
2069
2069
|
if (method === "GET" && cache !== false) {
|
|
2070
|
-
const cacheOptions = cacheProps ? cacheProps : __spreadProps$
|
|
2070
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$i(__spreadValues$v({}, objectRemoveEmpty({
|
|
2071
2071
|
headers,
|
|
2072
2072
|
withCredentials,
|
|
2073
2073
|
responseType,
|
|
@@ -2090,7 +2090,7 @@ class NgwConnector {
|
|
|
2090
2090
|
var _a;
|
|
2091
2091
|
if (this.user) {
|
|
2092
2092
|
options = options || {};
|
|
2093
|
-
options.headers = __spreadValues$
|
|
2093
|
+
options.headers = __spreadValues$v(__spreadValues$v({}, this.getAuthorizationHeaders()), options.headers);
|
|
2094
2094
|
}
|
|
2095
2095
|
if (this.requestTransform) {
|
|
2096
2096
|
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
@@ -2121,7 +2121,7 @@ class NgwConnector {
|
|
|
2121
2121
|
});
|
|
2122
2122
|
}
|
|
2123
2123
|
_login(credentials, options) {
|
|
2124
|
-
return __async$
|
|
2124
|
+
return __async$t(this, null, function* () {
|
|
2125
2125
|
try {
|
|
2126
2126
|
const data = yield this.getUserInfo(credentials, options);
|
|
2127
2127
|
this.user = data;
|
|
@@ -2149,7 +2149,7 @@ class NgwConnector {
|
|
|
2149
2149
|
return er;
|
|
2150
2150
|
}
|
|
2151
2151
|
}
|
|
2152
|
-
__publicField$
|
|
2152
|
+
__publicField$t(NgwConnector, "errors", errors);
|
|
2153
2153
|
|
|
2154
2154
|
function resourceCompare(res1, res2) {
|
|
2155
2155
|
return objectDeepEqual(res1, res2);
|
|
@@ -2179,27 +2179,27 @@ function resourceToQuery(resource, prefix = "") {
|
|
|
2179
2179
|
return query;
|
|
2180
2180
|
}
|
|
2181
2181
|
|
|
2182
|
-
var __defProp$
|
|
2183
|
-
var __defProps$
|
|
2184
|
-
var __getOwnPropDescs$
|
|
2185
|
-
var __getOwnPropSymbols$
|
|
2186
|
-
var __hasOwnProp$
|
|
2187
|
-
var __propIsEnum$
|
|
2188
|
-
var __defNormalProp$
|
|
2189
|
-
var __spreadValues$
|
|
2182
|
+
var __defProp$G = Object.defineProperty;
|
|
2183
|
+
var __defProps$h = Object.defineProperties;
|
|
2184
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
2185
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
2186
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
2187
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
2188
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2189
|
+
var __spreadValues$u = (a, b) => {
|
|
2190
2190
|
for (var prop in b || (b = {}))
|
|
2191
|
-
if (__hasOwnProp$
|
|
2192
|
-
__defNormalProp$
|
|
2193
|
-
if (__getOwnPropSymbols$
|
|
2194
|
-
for (var prop of __getOwnPropSymbols$
|
|
2195
|
-
if (__propIsEnum$
|
|
2196
|
-
__defNormalProp$
|
|
2191
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
2192
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
2193
|
+
if (__getOwnPropSymbols$v)
|
|
2194
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
2195
|
+
if (__propIsEnum$v.call(b, prop))
|
|
2196
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
2197
2197
|
}
|
|
2198
2198
|
return a;
|
|
2199
2199
|
};
|
|
2200
|
-
var __spreadProps$
|
|
2201
|
-
var __publicField$
|
|
2202
|
-
var __async$
|
|
2200
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
2201
|
+
var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2202
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
2203
2203
|
return new Promise((resolve, reject) => {
|
|
2204
2204
|
var fulfilled = (value) => {
|
|
2205
2205
|
try {
|
|
@@ -2224,8 +2224,8 @@ class ResourcesControl {
|
|
|
2224
2224
|
connector,
|
|
2225
2225
|
cacheId
|
|
2226
2226
|
}) {
|
|
2227
|
-
__publicField$
|
|
2228
|
-
__publicField$
|
|
2227
|
+
__publicField$s(this, "cache");
|
|
2228
|
+
__publicField$s(this, "connector");
|
|
2229
2229
|
this.connector = connector;
|
|
2230
2230
|
this.cache = new Cache({ namespace: cacheId });
|
|
2231
2231
|
}
|
|
@@ -2240,7 +2240,7 @@ class ResourcesControl {
|
|
|
2240
2240
|
* Fetching resource would be cached to speed up next call
|
|
2241
2241
|
*/
|
|
2242
2242
|
getOne(resource, requestOptions) {
|
|
2243
|
-
const opt = __spreadValues$
|
|
2243
|
+
const opt = __spreadValues$u({}, requestOptions);
|
|
2244
2244
|
if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
|
|
2245
2245
|
if (resource.id !== void 0) {
|
|
2246
2246
|
resource.id;
|
|
@@ -2317,8 +2317,8 @@ class ResourcesControl {
|
|
|
2317
2317
|
} else {
|
|
2318
2318
|
Object.assign(query, resourceToQuery(resource));
|
|
2319
2319
|
}
|
|
2320
|
-
return this.connector.route("resource.search").get(__spreadProps$
|
|
2321
|
-
query: __spreadValues$
|
|
2320
|
+
return this.connector.route("resource.search").get(__spreadProps$h(__spreadValues$u({}, requestOptions), {
|
|
2321
|
+
query: __spreadValues$u({
|
|
2322
2322
|
serialization: "full"
|
|
2323
2323
|
}, query)
|
|
2324
2324
|
})).then((resources) => {
|
|
@@ -2371,7 +2371,7 @@ class ResourcesControl {
|
|
|
2371
2371
|
});
|
|
2372
2372
|
}
|
|
2373
2373
|
_getChildrenOf(_0, _1) {
|
|
2374
|
-
return __async$
|
|
2374
|
+
return __async$s(this, arguments, function* (parentDef, requestOptions, _items = []) {
|
|
2375
2375
|
let parent = void 0;
|
|
2376
2376
|
if (typeof parentDef === "string") {
|
|
2377
2377
|
parent = yield this.getId(parentDef, requestOptions);
|
|
@@ -2380,7 +2380,7 @@ class ResourcesControl {
|
|
|
2380
2380
|
} else {
|
|
2381
2381
|
parent = parentDef;
|
|
2382
2382
|
}
|
|
2383
|
-
const items = yield this.connector.route("resource.collection").get(__spreadProps$
|
|
2383
|
+
const items = yield this.connector.route("resource.collection").get(__spreadProps$h(__spreadValues$u({}, requestOptions), {
|
|
2384
2384
|
query: {
|
|
2385
2385
|
parent
|
|
2386
2386
|
}
|
|
@@ -2408,7 +2408,7 @@ class ResourcesControl {
|
|
|
2408
2408
|
});
|
|
2409
2409
|
}
|
|
2410
2410
|
_cleanResourceItemCache(id) {
|
|
2411
|
-
return __async$
|
|
2411
|
+
return __async$s(this, null, function* () {
|
|
2412
2412
|
var _a;
|
|
2413
2413
|
const all = this.cache.all();
|
|
2414
2414
|
const toDelete = [];
|
|
@@ -2461,13 +2461,13 @@ class ResourcesControl {
|
|
|
2461
2461
|
}
|
|
2462
2462
|
}
|
|
2463
2463
|
|
|
2464
|
-
var __defProp$
|
|
2465
|
-
var __defNormalProp$
|
|
2466
|
-
var __publicField$
|
|
2464
|
+
var __defProp$F = Object.defineProperty;
|
|
2465
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2466
|
+
var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, key + "" , value);
|
|
2467
2467
|
class NgwConnectorExtended extends NgwConnector {
|
|
2468
2468
|
constructor(options) {
|
|
2469
2469
|
super(options);
|
|
2470
|
-
__publicField$
|
|
2470
|
+
__publicField$r(this, "resources");
|
|
2471
2471
|
this.resources = new ResourcesControl({
|
|
2472
2472
|
connector: this,
|
|
2473
2473
|
cacheId: options.cacheId
|
|
@@ -2677,25 +2677,25 @@ class NgwConnectorExtended extends NgwConnector {
|
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
2679
|
|
|
2680
|
-
var __defProp$
|
|
2681
|
-
var __defProps$
|
|
2682
|
-
var __getOwnPropDescs$
|
|
2683
|
-
var __getOwnPropSymbols$
|
|
2684
|
-
var __hasOwnProp$
|
|
2685
|
-
var __propIsEnum$
|
|
2686
|
-
var __defNormalProp$
|
|
2687
|
-
var __spreadValues$
|
|
2680
|
+
var __defProp$E = Object.defineProperty;
|
|
2681
|
+
var __defProps$g = Object.defineProperties;
|
|
2682
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
2683
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
2684
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
2685
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
2686
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2687
|
+
var __spreadValues$t = (a, b) => {
|
|
2688
2688
|
for (var prop in b || (b = {}))
|
|
2689
|
-
if (__hasOwnProp$
|
|
2690
|
-
__defNormalProp$
|
|
2691
|
-
if (__getOwnPropSymbols$
|
|
2692
|
-
for (var prop of __getOwnPropSymbols$
|
|
2693
|
-
if (__propIsEnum$
|
|
2694
|
-
__defNormalProp$
|
|
2689
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
2690
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
2691
|
+
if (__getOwnPropSymbols$u)
|
|
2692
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
2693
|
+
if (__propIsEnum$u.call(b, prop))
|
|
2694
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
2695
2695
|
}
|
|
2696
2696
|
return a;
|
|
2697
2697
|
};
|
|
2698
|
-
var __spreadProps$
|
|
2698
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
2699
2699
|
function getNgwWebmapExtent(webmap) {
|
|
2700
2700
|
const bottom = webmap["extent_bottom"];
|
|
2701
2701
|
const left = webmap["extent_left"];
|
|
@@ -2762,14 +2762,14 @@ function fetchNgwResourceExtent(item, connector, options) {
|
|
|
2762
2762
|
if (resource.cls && resource.parent && resource.cls.indexOf("style") !== -1) {
|
|
2763
2763
|
return connector.getResource(resource.parent.id, options).then((res) => {
|
|
2764
2764
|
if (res) {
|
|
2765
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2765
|
+
return fetchNgwLayerExtent(__spreadProps$g(__spreadValues$t({}, options), {
|
|
2766
2766
|
resourceId: res.resource.id,
|
|
2767
2767
|
connector
|
|
2768
2768
|
}));
|
|
2769
2769
|
}
|
|
2770
2770
|
});
|
|
2771
2771
|
} else {
|
|
2772
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2772
|
+
return fetchNgwLayerExtent(__spreadProps$g(__spreadValues$t({}, options), {
|
|
2773
2773
|
resourceId: resource.id,
|
|
2774
2774
|
connector
|
|
2775
2775
|
}));
|
|
@@ -2777,10 +2777,10 @@ function fetchNgwResourceExtent(item, connector, options) {
|
|
|
2777
2777
|
}
|
|
2778
2778
|
}
|
|
2779
2779
|
|
|
2780
|
-
var __defProp$
|
|
2781
|
-
var __defNormalProp$
|
|
2782
|
-
var __publicField$
|
|
2783
|
-
var __async$
|
|
2780
|
+
var __defProp$D = Object.defineProperty;
|
|
2781
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2782
|
+
var __publicField$q = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2783
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
2784
2784
|
return new Promise((resolve, reject) => {
|
|
2785
2785
|
var fulfilled = (value) => {
|
|
2786
2786
|
try {
|
|
@@ -2802,18 +2802,18 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
2802
2802
|
};
|
|
2803
2803
|
class NgwResource {
|
|
2804
2804
|
constructor() {
|
|
2805
|
-
__publicField$
|
|
2806
|
-
__publicField$
|
|
2807
|
-
__publicField$
|
|
2805
|
+
__publicField$q(this, "item");
|
|
2806
|
+
__publicField$q(this, "connector");
|
|
2807
|
+
__publicField$q(this, "_extent");
|
|
2808
2808
|
}
|
|
2809
2809
|
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
2810
2810
|
getExtent() {
|
|
2811
|
-
return __async$
|
|
2811
|
+
return __async$r(this, null, function* () {
|
|
2812
2812
|
return this.getBounds();
|
|
2813
2813
|
});
|
|
2814
2814
|
}
|
|
2815
2815
|
getBounds(options) {
|
|
2816
|
-
return __async$
|
|
2816
|
+
return __async$r(this, null, function* () {
|
|
2817
2817
|
if (this._extent) {
|
|
2818
2818
|
return this._extent;
|
|
2819
2819
|
}
|
|
@@ -2829,7 +2829,7 @@ class NgwResource {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
}
|
|
2831
2831
|
|
|
2832
|
-
var __async$
|
|
2832
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
2833
2833
|
return new Promise((resolve, reject) => {
|
|
2834
2834
|
var fulfilled = (value) => {
|
|
2835
2835
|
try {
|
|
@@ -2850,7 +2850,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
2850
2850
|
});
|
|
2851
2851
|
};
|
|
2852
2852
|
function resourceIdFromLayerOptions(options, connector) {
|
|
2853
|
-
return __async$
|
|
2853
|
+
return __async$q(this, null, function* () {
|
|
2854
2854
|
const resource = options.resource;
|
|
2855
2855
|
const item = resource;
|
|
2856
2856
|
let { keyname, resourceId } = options;
|
|
@@ -2875,24 +2875,24 @@ function resourceIdFromLayerOptions(options, connector) {
|
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
2877
|
|
|
2878
|
-
var __defProp$
|
|
2879
|
-
var __getOwnPropSymbols$
|
|
2880
|
-
var __hasOwnProp$
|
|
2881
|
-
var __propIsEnum$
|
|
2882
|
-
var __defNormalProp$
|
|
2883
|
-
var __spreadValues$
|
|
2878
|
+
var __defProp$C = Object.defineProperty;
|
|
2879
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
2880
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
2881
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
2882
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2883
|
+
var __spreadValues$s = (a, b) => {
|
|
2884
2884
|
for (var prop in b || (b = {}))
|
|
2885
|
-
if (__hasOwnProp$
|
|
2886
|
-
__defNormalProp$
|
|
2887
|
-
if (__getOwnPropSymbols$
|
|
2888
|
-
for (var prop of __getOwnPropSymbols$
|
|
2889
|
-
if (__propIsEnum$
|
|
2890
|
-
__defNormalProp$
|
|
2885
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
2886
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2887
|
+
if (__getOwnPropSymbols$t)
|
|
2888
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
2889
|
+
if (__propIsEnum$t.call(b, prop))
|
|
2890
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2891
2891
|
}
|
|
2892
2892
|
return a;
|
|
2893
2893
|
};
|
|
2894
|
-
var __publicField$
|
|
2895
|
-
var __async$
|
|
2894
|
+
var __publicField$p = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2895
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
2896
2896
|
return new Promise((resolve, reject) => {
|
|
2897
2897
|
var fulfilled = (value) => {
|
|
2898
2898
|
try {
|
|
@@ -2913,7 +2913,7 @@ var __async$o = (__this, __arguments, generator) => {
|
|
|
2913
2913
|
});
|
|
2914
2914
|
};
|
|
2915
2915
|
function createOnFirstShowAdapter(_0) {
|
|
2916
|
-
return __async$
|
|
2916
|
+
return __async$p(this, arguments, function* ({
|
|
2917
2917
|
webMap,
|
|
2918
2918
|
adapterOptions = {},
|
|
2919
2919
|
onLayerAdded,
|
|
@@ -2921,10 +2921,10 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2921
2921
|
}) {
|
|
2922
2922
|
class OnFirstShowAdapter {
|
|
2923
2923
|
constructor() {
|
|
2924
|
-
__publicField$
|
|
2925
|
-
__publicField$
|
|
2926
|
-
__publicField$
|
|
2927
|
-
__publicField$
|
|
2924
|
+
__publicField$p(this, "options", {});
|
|
2925
|
+
__publicField$p(this, "layer", []);
|
|
2926
|
+
__publicField$p(this, "_removed", false);
|
|
2927
|
+
__publicField$p(this, "_creatingInProgress", false);
|
|
2928
2928
|
}
|
|
2929
2929
|
addLayer() {
|
|
2930
2930
|
return this.layer;
|
|
@@ -2939,7 +2939,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2939
2939
|
return this._removed;
|
|
2940
2940
|
}
|
|
2941
2941
|
showLayer() {
|
|
2942
|
-
return __async$
|
|
2942
|
+
return __async$p(this, null, function* () {
|
|
2943
2943
|
this.options.visibility = true;
|
|
2944
2944
|
if (this.layer.length) {
|
|
2945
2945
|
for (const x of this.layer) {
|
|
@@ -2951,7 +2951,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2951
2951
|
});
|
|
2952
2952
|
}
|
|
2953
2953
|
hideLayer() {
|
|
2954
|
-
return __async$
|
|
2954
|
+
return __async$p(this, null, function* () {
|
|
2955
2955
|
this.options.visibility = false;
|
|
2956
2956
|
if (this.layer) {
|
|
2957
2957
|
for (const x of this.layer) {
|
|
@@ -2961,12 +2961,12 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2961
2961
|
});
|
|
2962
2962
|
}
|
|
2963
2963
|
loadLayer() {
|
|
2964
|
-
return __async$
|
|
2964
|
+
return __async$p(this, null, function* () {
|
|
2965
2965
|
if (!this.layer.length && !this._creatingInProgress) {
|
|
2966
2966
|
this._creatingInProgress = true;
|
|
2967
2967
|
const Adapter = yield createAdapter(this);
|
|
2968
2968
|
if (Adapter) {
|
|
2969
|
-
const adapter = new Adapter(webMap.mapAdapter.map, __spreadValues$
|
|
2969
|
+
const adapter = new Adapter(webMap.mapAdapter.map, __spreadValues$s({}, adapterOptions));
|
|
2970
2970
|
const realLayer = yield adapter.addLayer({
|
|
2971
2971
|
order: this.options.order,
|
|
2972
2972
|
headers: this.options.headers,
|
|
@@ -2995,7 +2995,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2995
2995
|
});
|
|
2996
2996
|
}
|
|
2997
2997
|
|
|
2998
|
-
var __async$
|
|
2998
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
2999
2999
|
return new Promise((resolve, reject) => {
|
|
3000
3000
|
var fulfilled = (value) => {
|
|
3001
3001
|
try {
|
|
@@ -3016,7 +3016,7 @@ var __async$n = (__this, __arguments, generator) => {
|
|
|
3016
3016
|
});
|
|
3017
3017
|
};
|
|
3018
3018
|
function createOnFirstShowNgwAdapter(_0) {
|
|
3019
|
-
return __async$
|
|
3019
|
+
return __async$o(this, arguments, function* ({
|
|
3020
3020
|
webMap,
|
|
3021
3021
|
connector,
|
|
3022
3022
|
item,
|
|
@@ -3050,19 +3050,19 @@ function createOnFirstShowNgwAdapter(_0) {
|
|
|
3050
3050
|
});
|
|
3051
3051
|
}
|
|
3052
3052
|
|
|
3053
|
-
var __defProp$
|
|
3054
|
-
var __getOwnPropSymbols$
|
|
3055
|
-
var __hasOwnProp$
|
|
3056
|
-
var __propIsEnum$
|
|
3057
|
-
var __defNormalProp$
|
|
3058
|
-
var __spreadValues$
|
|
3053
|
+
var __defProp$B = Object.defineProperty;
|
|
3054
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
3055
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
3056
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
3057
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3058
|
+
var __spreadValues$r = (a, b) => {
|
|
3059
3059
|
for (var prop in b || (b = {}))
|
|
3060
|
-
if (__hasOwnProp$
|
|
3061
|
-
__defNormalProp$
|
|
3062
|
-
if (__getOwnPropSymbols$
|
|
3063
|
-
for (var prop of __getOwnPropSymbols$
|
|
3064
|
-
if (__propIsEnum$
|
|
3065
|
-
__defNormalProp$
|
|
3060
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
3061
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
3062
|
+
if (__getOwnPropSymbols$s)
|
|
3063
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
3064
|
+
if (__propIsEnum$s.call(b, prop))
|
|
3065
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
3066
3066
|
}
|
|
3067
3067
|
return a;
|
|
3068
3068
|
};
|
|
@@ -3109,7 +3109,7 @@ function isPropertyFilter(filter) {
|
|
|
3109
3109
|
return false;
|
|
3110
3110
|
}
|
|
3111
3111
|
function featureFilter(feature, filters) {
|
|
3112
|
-
const properties = __spreadValues$
|
|
3112
|
+
const properties = __spreadValues$r({}, feature.properties);
|
|
3113
3113
|
if (properties) {
|
|
3114
3114
|
properties.$id = feature.id;
|
|
3115
3115
|
return propertiesFilter(properties, filters);
|
|
@@ -3148,26 +3148,26 @@ const config = {
|
|
|
3148
3148
|
defaultRequestLimit: 7e3
|
|
3149
3149
|
};
|
|
3150
3150
|
|
|
3151
|
-
var __defProp$
|
|
3152
|
-
var __defProps$
|
|
3153
|
-
var __getOwnPropDescs$
|
|
3154
|
-
var __getOwnPropSymbols$
|
|
3155
|
-
var __hasOwnProp$
|
|
3156
|
-
var __propIsEnum$
|
|
3157
|
-
var __defNormalProp$
|
|
3158
|
-
var __spreadValues$
|
|
3151
|
+
var __defProp$A = Object.defineProperty;
|
|
3152
|
+
var __defProps$f = Object.defineProperties;
|
|
3153
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
3154
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
3155
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
3156
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
3157
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3158
|
+
var __spreadValues$q = (a, b) => {
|
|
3159
3159
|
for (var prop in b || (b = {}))
|
|
3160
|
-
if (__hasOwnProp$
|
|
3161
|
-
__defNormalProp$
|
|
3162
|
-
if (__getOwnPropSymbols$
|
|
3163
|
-
for (var prop of __getOwnPropSymbols$
|
|
3164
|
-
if (__propIsEnum$
|
|
3165
|
-
__defNormalProp$
|
|
3160
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
3161
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
3162
|
+
if (__getOwnPropSymbols$r)
|
|
3163
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
3164
|
+
if (__propIsEnum$r.call(b, prop))
|
|
3165
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
3166
3166
|
}
|
|
3167
3167
|
return a;
|
|
3168
3168
|
};
|
|
3169
|
-
var __spreadProps$
|
|
3170
|
-
var __async$
|
|
3169
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
3170
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
3171
3171
|
return new Promise((resolve, reject) => {
|
|
3172
3172
|
var fulfilled = (value) => {
|
|
3173
3173
|
try {
|
|
@@ -3234,7 +3234,7 @@ function paramListToQuery(paramList) {
|
|
|
3234
3234
|
);
|
|
3235
3235
|
}
|
|
3236
3236
|
function createFeatureFieldFilterQueries(opt) {
|
|
3237
|
-
return __async$
|
|
3237
|
+
return __async$n(this, null, function* () {
|
|
3238
3238
|
const queries = getQueries(opt);
|
|
3239
3239
|
const itemsParts = yield Promise.all(queries);
|
|
3240
3240
|
const ids = [];
|
|
@@ -3278,13 +3278,13 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3278
3278
|
for (const f of filters_) {
|
|
3279
3279
|
if (isPropertyFilter(f)) {
|
|
3280
3280
|
_queries.push(
|
|
3281
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3281
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3282
3282
|
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
3283
3283
|
}))
|
|
3284
3284
|
);
|
|
3285
3285
|
} else {
|
|
3286
3286
|
getQueries(
|
|
3287
|
-
__spreadProps$
|
|
3287
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3288
3288
|
filters: f
|
|
3289
3289
|
}),
|
|
3290
3290
|
_queries,
|
|
@@ -3305,7 +3305,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3305
3305
|
if (propertiesFilterList.length) {
|
|
3306
3306
|
for (const x of propertiesFilterList) {
|
|
3307
3307
|
getQueries(
|
|
3308
|
-
__spreadProps$
|
|
3308
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3309
3309
|
filters: x
|
|
3310
3310
|
}),
|
|
3311
3311
|
_queries,
|
|
@@ -3314,7 +3314,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3314
3314
|
}
|
|
3315
3315
|
} else {
|
|
3316
3316
|
_queries.push(
|
|
3317
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3317
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3318
3318
|
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
3319
3319
|
}))
|
|
3320
3320
|
);
|
|
@@ -3330,7 +3330,7 @@ function createWktFromCoordArray(coord) {
|
|
|
3330
3330
|
return `POLYGON((${polygon.join(", ")}))`;
|
|
3331
3331
|
}
|
|
3332
3332
|
function fetchNgwLayerItemsRequest(options) {
|
|
3333
|
-
const params = __spreadValues$
|
|
3333
|
+
const params = __spreadValues$q({}, FEATURE_REQUEST_PARAMS);
|
|
3334
3334
|
const {
|
|
3335
3335
|
limit,
|
|
3336
3336
|
query,
|
|
@@ -3368,7 +3368,7 @@ function fetchNgwLayerItemsRequest(options) {
|
|
|
3368
3368
|
if (paramList) {
|
|
3369
3369
|
Object.assign(params, paramListToQuery(paramList));
|
|
3370
3370
|
}
|
|
3371
|
-
return connector.route("feature_layer.feature.collection", { id: Number(resourceId) }).get({ query: __spreadValues$
|
|
3371
|
+
return connector.route("feature_layer.feature.collection", { id: Number(resourceId) }).get({ query: __spreadValues$q(__spreadValues$q({}, params), query), cache, signal });
|
|
3372
3372
|
}
|
|
3373
3373
|
|
|
3374
3374
|
function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
@@ -3397,26 +3397,26 @@ function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
|
3397
3397
|
return fields;
|
|
3398
3398
|
}
|
|
3399
3399
|
|
|
3400
|
-
var __defProp$
|
|
3401
|
-
var __defProps$
|
|
3402
|
-
var __getOwnPropDescs$
|
|
3403
|
-
var __getOwnPropSymbols$
|
|
3404
|
-
var __hasOwnProp$
|
|
3405
|
-
var __propIsEnum$
|
|
3406
|
-
var __defNormalProp$
|
|
3407
|
-
var __spreadValues$
|
|
3400
|
+
var __defProp$z = Object.defineProperty;
|
|
3401
|
+
var __defProps$e = Object.defineProperties;
|
|
3402
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
3403
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
3404
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
3405
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
3406
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3407
|
+
var __spreadValues$p = (a, b) => {
|
|
3408
3408
|
for (var prop in b || (b = {}))
|
|
3409
|
-
if (__hasOwnProp$
|
|
3410
|
-
__defNormalProp$
|
|
3411
|
-
if (__getOwnPropSymbols$
|
|
3412
|
-
for (var prop of __getOwnPropSymbols$
|
|
3413
|
-
if (__propIsEnum$
|
|
3414
|
-
__defNormalProp$
|
|
3409
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
3410
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
3411
|
+
if (__getOwnPropSymbols$q)
|
|
3412
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
3413
|
+
if (__propIsEnum$q.call(b, prop))
|
|
3414
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
3415
3415
|
}
|
|
3416
3416
|
return a;
|
|
3417
3417
|
};
|
|
3418
|
-
var __spreadProps$
|
|
3419
|
-
var __async$
|
|
3418
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
3419
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
3420
3420
|
return new Promise((resolve, reject) => {
|
|
3421
3421
|
var fulfilled = (value) => {
|
|
3422
3422
|
try {
|
|
@@ -3437,17 +3437,17 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
3437
3437
|
});
|
|
3438
3438
|
};
|
|
3439
3439
|
function fetchNgwLayerItems(options) {
|
|
3440
|
-
return __async$
|
|
3440
|
+
return __async$m(this, null, function* () {
|
|
3441
3441
|
var _a;
|
|
3442
3442
|
const filters = options.filters;
|
|
3443
3443
|
if (filters) {
|
|
3444
|
-
let data = yield createFeatureFieldFilterQueries(__spreadProps$
|
|
3444
|
+
let data = yield createFeatureFieldFilterQueries(__spreadProps$e(__spreadValues$p({}, options), {
|
|
3445
3445
|
filters
|
|
3446
3446
|
}));
|
|
3447
3447
|
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
|
|
3448
3448
|
if (clientFilterValidate) {
|
|
3449
3449
|
data = data.filter((y) => {
|
|
3450
|
-
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$
|
|
3450
|
+
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$e(__spreadValues$p({}, y.fields), {
|
|
3451
3451
|
id: y.id
|
|
3452
3452
|
}));
|
|
3453
3453
|
const result = propertiesFilter(fields, filters);
|
|
@@ -3565,26 +3565,26 @@ function ngwApiToAdapterOptions({
|
|
|
3565
3565
|
}
|
|
3566
3566
|
}
|
|
3567
3567
|
|
|
3568
|
-
var __defProp$
|
|
3569
|
-
var __defProps$
|
|
3570
|
-
var __getOwnPropDescs$
|
|
3571
|
-
var __getOwnPropSymbols$
|
|
3572
|
-
var __hasOwnProp$
|
|
3573
|
-
var __propIsEnum$
|
|
3574
|
-
var __defNormalProp$
|
|
3575
|
-
var __spreadValues$
|
|
3568
|
+
var __defProp$y = Object.defineProperty;
|
|
3569
|
+
var __defProps$d = Object.defineProperties;
|
|
3570
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
3571
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
3572
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
3573
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
3574
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3575
|
+
var __spreadValues$o = (a, b) => {
|
|
3576
3576
|
for (var prop in b || (b = {}))
|
|
3577
|
-
if (__hasOwnProp$
|
|
3578
|
-
__defNormalProp$
|
|
3579
|
-
if (__getOwnPropSymbols$
|
|
3580
|
-
for (var prop of __getOwnPropSymbols$
|
|
3581
|
-
if (__propIsEnum$
|
|
3582
|
-
__defNormalProp$
|
|
3577
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
3578
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
3579
|
+
if (__getOwnPropSymbols$p)
|
|
3580
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
3581
|
+
if (__propIsEnum$p.call(b, prop))
|
|
3582
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
3583
3583
|
}
|
|
3584
3584
|
return a;
|
|
3585
3585
|
};
|
|
3586
|
-
var __spreadProps$
|
|
3587
|
-
var __async$
|
|
3586
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
3587
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
3588
3588
|
return new Promise((resolve, reject) => {
|
|
3589
3589
|
var fulfilled = (value) => {
|
|
3590
3590
|
try {
|
|
@@ -3605,56 +3605,56 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
3605
3605
|
});
|
|
3606
3606
|
};
|
|
3607
3607
|
function fetchNgwLayerItem(options) {
|
|
3608
|
-
return __async$
|
|
3609
|
-
const params = __spreadValues$
|
|
3608
|
+
return __async$l(this, null, function* () {
|
|
3609
|
+
const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
|
|
3610
3610
|
updateItemRequestParam(params, options);
|
|
3611
3611
|
const resp = yield options.connector.route("feature_layer.feature.item", {
|
|
3612
3612
|
id: Number(options.resourceId),
|
|
3613
3613
|
fid: options.featureId
|
|
3614
|
-
}).get(__spreadProps$
|
|
3615
|
-
const toGeojson = () => __async$
|
|
3614
|
+
}).get(__spreadProps$d(__spreadValues$o({}, options), { query: params }));
|
|
3615
|
+
const toGeojson = () => __async$l(this, null, function* () {
|
|
3616
3616
|
if (resp.geom) {
|
|
3617
3617
|
return createGeoJsonFeature(resp);
|
|
3618
3618
|
} else {
|
|
3619
|
-
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$
|
|
3619
|
+
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$d(__spreadValues$o({}, options), {
|
|
3620
3620
|
geom: true,
|
|
3621
3621
|
fields: null,
|
|
3622
3622
|
extensions: null
|
|
3623
3623
|
}));
|
|
3624
3624
|
const geom = onlyGeomItem.geom;
|
|
3625
|
-
return createGeoJsonFeature(__spreadProps$
|
|
3625
|
+
return createGeoJsonFeature(__spreadProps$d(__spreadValues$o({}, resp), { geom }));
|
|
3626
3626
|
}
|
|
3627
3627
|
});
|
|
3628
|
-
return __spreadProps$
|
|
3628
|
+
return __spreadProps$d(__spreadValues$o({}, resp), {
|
|
3629
3629
|
toGeojson
|
|
3630
3630
|
});
|
|
3631
3631
|
});
|
|
3632
3632
|
}
|
|
3633
3633
|
|
|
3634
|
-
var __defProp$
|
|
3635
|
-
var __getOwnPropSymbols$
|
|
3636
|
-
var __hasOwnProp$
|
|
3637
|
-
var __propIsEnum$
|
|
3638
|
-
var __defNormalProp$
|
|
3639
|
-
var __spreadValues$
|
|
3634
|
+
var __defProp$x = Object.defineProperty;
|
|
3635
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
3636
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
3637
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
3638
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3639
|
+
var __spreadValues$n = (a, b) => {
|
|
3640
3640
|
for (var prop in b || (b = {}))
|
|
3641
|
-
if (__hasOwnProp$
|
|
3642
|
-
__defNormalProp$
|
|
3643
|
-
if (__getOwnPropSymbols$
|
|
3644
|
-
for (var prop of __getOwnPropSymbols$
|
|
3645
|
-
if (__propIsEnum$
|
|
3646
|
-
__defNormalProp$
|
|
3641
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
3642
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
3643
|
+
if (__getOwnPropSymbols$o)
|
|
3644
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
3645
|
+
if (__propIsEnum$o.call(b, prop))
|
|
3646
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
3647
3647
|
}
|
|
3648
3648
|
return a;
|
|
3649
3649
|
};
|
|
3650
|
-
var __publicField$
|
|
3650
|
+
var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3651
3651
|
class BookmarkItem {
|
|
3652
3652
|
constructor(options) {
|
|
3653
3653
|
this.options = options;
|
|
3654
|
-
__publicField$
|
|
3655
|
-
__publicField$
|
|
3656
|
-
__publicField$
|
|
3657
|
-
__publicField$
|
|
3654
|
+
__publicField$o(this, "name");
|
|
3655
|
+
__publicField$o(this, "resourceId");
|
|
3656
|
+
__publicField$o(this, "item");
|
|
3657
|
+
__publicField$o(this, "_extent");
|
|
3658
3658
|
this.resourceId = options.resourceId;
|
|
3659
3659
|
const item = options.item;
|
|
3660
3660
|
this.item = item;
|
|
@@ -3684,7 +3684,7 @@ class BookmarkItem {
|
|
|
3684
3684
|
if (this.item.geom) {
|
|
3685
3685
|
return Promise.resolve(createGeoJsonFeature(this.item));
|
|
3686
3686
|
} else {
|
|
3687
|
-
return fetchNgwLayerItem(__spreadValues$
|
|
3687
|
+
return fetchNgwLayerItem(__spreadValues$n({
|
|
3688
3688
|
resourceId: this.resourceId,
|
|
3689
3689
|
featureId: this.item.id,
|
|
3690
3690
|
connector: this.options.connector,
|
|
@@ -3702,19 +3702,19 @@ class BookmarkItem {
|
|
|
3702
3702
|
|
|
3703
3703
|
const WEBMAP_BASELAYER_ID_PREFIX = "webmap-baselayer";
|
|
3704
3704
|
|
|
3705
|
-
var __defProp$
|
|
3706
|
-
var __defNormalProp$
|
|
3707
|
-
var __publicField$
|
|
3705
|
+
var __defProp$w = Object.defineProperty;
|
|
3706
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3707
|
+
var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3708
3708
|
class BaseProperty {
|
|
3709
3709
|
constructor(name, item, options) {
|
|
3710
|
-
__publicField$
|
|
3711
|
-
__publicField$
|
|
3712
|
-
__publicField$
|
|
3713
|
-
__publicField$
|
|
3714
|
-
__publicField$
|
|
3715
|
-
__publicField$
|
|
3716
|
-
__publicField$
|
|
3717
|
-
__publicField$
|
|
3710
|
+
__publicField$n(this, "options");
|
|
3711
|
+
__publicField$n(this, "emitter", new EventEmitter());
|
|
3712
|
+
__publicField$n(this, "name");
|
|
3713
|
+
__publicField$n(this, "item");
|
|
3714
|
+
__publicField$n(this, "_blocked", false);
|
|
3715
|
+
__publicField$n(this, "_container");
|
|
3716
|
+
__publicField$n(this, "_value");
|
|
3717
|
+
__publicField$n(this, "_removeEventsListener");
|
|
3718
3718
|
this.item = item;
|
|
3719
3719
|
this.options = Object.assign({}, options);
|
|
3720
3720
|
this.name = name;
|
|
@@ -3811,26 +3811,26 @@ class BaseProperty {
|
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
3813
|
|
|
3814
|
-
var __defProp$
|
|
3815
|
-
var __getOwnPropSymbols$
|
|
3816
|
-
var __hasOwnProp$
|
|
3817
|
-
var __propIsEnum$
|
|
3818
|
-
var __defNormalProp$
|
|
3819
|
-
var __spreadValues$
|
|
3814
|
+
var __defProp$v = Object.defineProperty;
|
|
3815
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
3816
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
3817
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
3818
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3819
|
+
var __spreadValues$m = (a, b) => {
|
|
3820
3820
|
for (var prop in b || (b = {}))
|
|
3821
|
-
if (__hasOwnProp$
|
|
3822
|
-
__defNormalProp$
|
|
3823
|
-
if (__getOwnPropSymbols$
|
|
3824
|
-
for (var prop of __getOwnPropSymbols$
|
|
3825
|
-
if (__propIsEnum$
|
|
3826
|
-
__defNormalProp$
|
|
3821
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
3822
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
3823
|
+
if (__getOwnPropSymbols$n)
|
|
3824
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
3825
|
+
if (__propIsEnum$n.call(b, prop))
|
|
3826
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
3827
3827
|
}
|
|
3828
3828
|
return a;
|
|
3829
3829
|
};
|
|
3830
|
-
var __publicField$
|
|
3830
|
+
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, key + "" , value);
|
|
3831
3831
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
3832
3832
|
constructor(name, item, options) {
|
|
3833
|
-
super(name, item, __spreadValues$
|
|
3833
|
+
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
3834
3834
|
this.set(this.get());
|
|
3835
3835
|
}
|
|
3836
3836
|
update(value, options) {
|
|
@@ -3926,7 +3926,7 @@ const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
|
3926
3926
|
const child = children[fry];
|
|
3927
3927
|
const property = child.properties && child.properties.property(this.name);
|
|
3928
3928
|
if (property) {
|
|
3929
|
-
property.set(value, __spreadValues$
|
|
3929
|
+
property.set(value, __spreadValues$m(__spreadValues$m({}, options), {
|
|
3930
3930
|
propagation: true,
|
|
3931
3931
|
bubble: false
|
|
3932
3932
|
}));
|
|
@@ -3935,7 +3935,7 @@ const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
|
3935
3935
|
}
|
|
3936
3936
|
}
|
|
3937
3937
|
};
|
|
3938
|
-
__publicField$
|
|
3938
|
+
__publicField$m(_CheckProperty, "options", {
|
|
3939
3939
|
hierarchy: true,
|
|
3940
3940
|
bubble: false,
|
|
3941
3941
|
propagation: false,
|
|
@@ -3944,31 +3944,31 @@ __publicField$l(_CheckProperty, "options", {
|
|
|
3944
3944
|
});
|
|
3945
3945
|
let CheckProperty = _CheckProperty;
|
|
3946
3946
|
|
|
3947
|
-
var __defProp$
|
|
3948
|
-
var __getOwnPropSymbols$
|
|
3949
|
-
var __hasOwnProp$
|
|
3950
|
-
var __propIsEnum$
|
|
3951
|
-
var __defNormalProp$
|
|
3952
|
-
var __spreadValues$
|
|
3947
|
+
var __defProp$u = Object.defineProperty;
|
|
3948
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
3949
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
3950
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
3951
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3952
|
+
var __spreadValues$l = (a, b) => {
|
|
3953
3953
|
for (var prop in b || (b = {}))
|
|
3954
|
-
if (__hasOwnProp$
|
|
3955
|
-
__defNormalProp$
|
|
3956
|
-
if (__getOwnPropSymbols$
|
|
3957
|
-
for (var prop of __getOwnPropSymbols$
|
|
3958
|
-
if (__propIsEnum$
|
|
3959
|
-
__defNormalProp$
|
|
3954
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
3955
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
3956
|
+
if (__getOwnPropSymbols$m)
|
|
3957
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
3958
|
+
if (__propIsEnum$m.call(b, prop))
|
|
3959
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
3960
3960
|
}
|
|
3961
3961
|
return a;
|
|
3962
3962
|
};
|
|
3963
|
-
var __publicField$
|
|
3963
|
+
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3964
3964
|
const BOOLEAN_TYPE = "boolean";
|
|
3965
3965
|
const STRING_TYPE = "string";
|
|
3966
3966
|
const _ItemProperties = class _ItemProperties {
|
|
3967
3967
|
constructor(item, propertiesList) {
|
|
3968
3968
|
this.item = item;
|
|
3969
|
-
__publicField$
|
|
3970
|
-
__publicField$
|
|
3971
|
-
__publicField$
|
|
3969
|
+
__publicField$l(this, "options", {});
|
|
3970
|
+
__publicField$l(this, "_properties", {});
|
|
3971
|
+
__publicField$l(this, "_propertiesList", []);
|
|
3972
3972
|
if (propertiesList) {
|
|
3973
3973
|
propertiesList.forEach(this._setPropertyHandler.bind(this));
|
|
3974
3974
|
}
|
|
@@ -4008,7 +4008,7 @@ const _ItemProperties = class _ItemProperties {
|
|
|
4008
4008
|
_setPropertyHandler(propOpt) {
|
|
4009
4009
|
const Handler = this._getHandler(propOpt);
|
|
4010
4010
|
if (Handler && propOpt.name) {
|
|
4011
|
-
const options = __spreadValues$
|
|
4011
|
+
const options = __spreadValues$l({}, propOpt);
|
|
4012
4012
|
this._properties[propOpt.name] = new Handler(
|
|
4013
4013
|
propOpt.name,
|
|
4014
4014
|
this.item,
|
|
@@ -4031,7 +4031,7 @@ const _ItemProperties = class _ItemProperties {
|
|
|
4031
4031
|
return Handler;
|
|
4032
4032
|
}
|
|
4033
4033
|
};
|
|
4034
|
-
__publicField$
|
|
4034
|
+
__publicField$l(_ItemProperties, "handlers", {
|
|
4035
4035
|
CheckProperty
|
|
4036
4036
|
});
|
|
4037
4037
|
let ItemProperties = _ItemProperties;
|
|
@@ -4138,14 +4138,14 @@ function treeEvery_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
|
|
|
4138
4138
|
return true;
|
|
4139
4139
|
}
|
|
4140
4140
|
|
|
4141
|
-
var __defProp$
|
|
4142
|
-
var __defNormalProp$
|
|
4143
|
-
var __publicField$
|
|
4141
|
+
var __defProp$t = Object.defineProperty;
|
|
4142
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4143
|
+
var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4144
4144
|
class TreeHelper {
|
|
4145
4145
|
constructor(item) {
|
|
4146
|
-
__publicField$
|
|
4147
|
-
__publicField$
|
|
4148
|
-
__publicField$
|
|
4146
|
+
__publicField$k(this, "item");
|
|
4147
|
+
__publicField$k(this, "_children", []);
|
|
4148
|
+
__publicField$k(this, "_parent");
|
|
4149
4149
|
this.item = item;
|
|
4150
4150
|
}
|
|
4151
4151
|
setParent(parent) {
|
|
@@ -4208,32 +4208,32 @@ class TreeHelper {
|
|
|
4208
4208
|
}
|
|
4209
4209
|
}
|
|
4210
4210
|
|
|
4211
|
-
var __defProp$
|
|
4212
|
-
var __getOwnPropSymbols$
|
|
4213
|
-
var __hasOwnProp$
|
|
4214
|
-
var __propIsEnum$
|
|
4215
|
-
var __defNormalProp$
|
|
4216
|
-
var __spreadValues$
|
|
4211
|
+
var __defProp$s = Object.defineProperty;
|
|
4212
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
4213
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
4214
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
4215
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4216
|
+
var __spreadValues$k = (a, b) => {
|
|
4217
4217
|
for (var prop in b || (b = {}))
|
|
4218
|
-
if (__hasOwnProp$
|
|
4219
|
-
__defNormalProp$
|
|
4220
|
-
if (__getOwnPropSymbols$
|
|
4221
|
-
for (var prop of __getOwnPropSymbols$
|
|
4222
|
-
if (__propIsEnum$
|
|
4223
|
-
__defNormalProp$
|
|
4218
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
4219
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
4220
|
+
if (__getOwnPropSymbols$l)
|
|
4221
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
4222
|
+
if (__propIsEnum$l.call(b, prop))
|
|
4223
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
4224
4224
|
}
|
|
4225
4225
|
return a;
|
|
4226
4226
|
};
|
|
4227
|
-
var __publicField$
|
|
4227
|
+
var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4228
4228
|
let ID$1 = 0;
|
|
4229
4229
|
class Item {
|
|
4230
4230
|
constructor(options) {
|
|
4231
|
-
__publicField$
|
|
4232
|
-
__publicField$
|
|
4233
|
-
__publicField$
|
|
4234
|
-
__publicField$
|
|
4231
|
+
__publicField$j(this, "options", {});
|
|
4232
|
+
__publicField$j(this, "properties");
|
|
4233
|
+
__publicField$j(this, "tree");
|
|
4234
|
+
__publicField$j(this, "id", ID$1);
|
|
4235
4235
|
ID$1 += 1;
|
|
4236
|
-
this.options = __spreadValues$
|
|
4236
|
+
this.options = __spreadValues$k({}, options);
|
|
4237
4237
|
this.tree = new TreeHelper(this);
|
|
4238
4238
|
}
|
|
4239
4239
|
initProperties() {
|
|
@@ -4285,6 +4285,168 @@ class WebmapLayerOpacityPropertyHandler extends BaseProperty {
|
|
|
4285
4285
|
}
|
|
4286
4286
|
}
|
|
4287
4287
|
|
|
4288
|
+
function createLayerSymbolParam(resourceId, intervals) {
|
|
4289
|
+
return { [`symbols[${resourceId}]`]: intervals.join(",") || void 0 };
|
|
4290
|
+
}
|
|
4291
|
+
|
|
4292
|
+
var __defProp$r = Object.defineProperty;
|
|
4293
|
+
var __defProps$c = Object.defineProperties;
|
|
4294
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
4295
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
4296
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
4297
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
4298
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4299
|
+
var __spreadValues$j = (a, b) => {
|
|
4300
|
+
for (var prop in b || (b = {}))
|
|
4301
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
4302
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4303
|
+
if (__getOwnPropSymbols$k)
|
|
4304
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
4305
|
+
if (__propIsEnum$k.call(b, prop))
|
|
4306
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4307
|
+
}
|
|
4308
|
+
return a;
|
|
4309
|
+
};
|
|
4310
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
4311
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4312
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
4313
|
+
return new Promise((resolve, reject) => {
|
|
4314
|
+
var fulfilled = (value) => {
|
|
4315
|
+
try {
|
|
4316
|
+
step(generator.next(value));
|
|
4317
|
+
} catch (e) {
|
|
4318
|
+
reject(e);
|
|
4319
|
+
}
|
|
4320
|
+
};
|
|
4321
|
+
var rejected = (value) => {
|
|
4322
|
+
try {
|
|
4323
|
+
step(generator.throw(value));
|
|
4324
|
+
} catch (e) {
|
|
4325
|
+
reject(e);
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
4329
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
4330
|
+
});
|
|
4331
|
+
};
|
|
4332
|
+
class Legend {
|
|
4333
|
+
constructor({
|
|
4334
|
+
legendSymbols,
|
|
4335
|
+
resourceId,
|
|
4336
|
+
connector,
|
|
4337
|
+
layerId,
|
|
4338
|
+
legend,
|
|
4339
|
+
webMap,
|
|
4340
|
+
layer,
|
|
4341
|
+
onSymbolRenderChange
|
|
4342
|
+
}) {
|
|
4343
|
+
__publicField$i(this, "layerId");
|
|
4344
|
+
__publicField$i(this, "layer");
|
|
4345
|
+
__publicField$i(this, "resourceId");
|
|
4346
|
+
__publicField$i(this, "legendSymbols", "expand");
|
|
4347
|
+
__publicField$i(this, "legend");
|
|
4348
|
+
// private blocked: boolean = false;
|
|
4349
|
+
__publicField$i(this, "layerVisibility", true);
|
|
4350
|
+
// private symbolRenderIndexes?: number[];
|
|
4351
|
+
__publicField$i(this, "onSymbolRenderChange");
|
|
4352
|
+
__publicField$i(this, "webMap");
|
|
4353
|
+
__publicField$i(this, "connector");
|
|
4354
|
+
if (legendSymbols) {
|
|
4355
|
+
this.legendSymbols = legendSymbols;
|
|
4356
|
+
}
|
|
4357
|
+
this.connector = connector;
|
|
4358
|
+
this.layer = layer;
|
|
4359
|
+
this.layerId = layerId;
|
|
4360
|
+
if (legend) {
|
|
4361
|
+
this.legend = this.createLegend(legend);
|
|
4362
|
+
}
|
|
4363
|
+
this.resourceId = resourceId;
|
|
4364
|
+
this.webMap = webMap;
|
|
4365
|
+
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
4366
|
+
}
|
|
4367
|
+
attachLayer(layer) {
|
|
4368
|
+
this.layerId = String(layer.id);
|
|
4369
|
+
this.layer = layer;
|
|
4370
|
+
}
|
|
4371
|
+
create() {
|
|
4372
|
+
return __async$k(this, arguments, function* (options = {}) {
|
|
4373
|
+
if (this.connector) {
|
|
4374
|
+
const ngwLegend = yield this.connector.route("render.legend_symbols", {
|
|
4375
|
+
id: this.resourceId
|
|
4376
|
+
}).get(__spreadValues$j({}, options));
|
|
4377
|
+
this.legend = ngwLegend;
|
|
4378
|
+
return this.createLegend(ngwLegend);
|
|
4379
|
+
}
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
createLegend(items) {
|
|
4383
|
+
return items.map((params) => __spreadProps$c(__spreadValues$j({}, params), {
|
|
4384
|
+
/** @deprecated use display_name instead */
|
|
4385
|
+
name: params.display_name,
|
|
4386
|
+
/** @deprecated use icon instead */
|
|
4387
|
+
symbol: params.icon
|
|
4388
|
+
}));
|
|
4389
|
+
}
|
|
4390
|
+
setSymbolRender(symbolIndex, status) {
|
|
4391
|
+
if (this.legend) {
|
|
4392
|
+
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
4393
|
+
if (legendItem) {
|
|
4394
|
+
const render = legendItem.render;
|
|
4395
|
+
if (render !== status) {
|
|
4396
|
+
legendItem.render = status;
|
|
4397
|
+
const newSymbols = this.legend.filter((l) => l.render).map((l) => l.index);
|
|
4398
|
+
this.setLegendSymbol(newSymbols);
|
|
4399
|
+
if (this.onSymbolRenderChange) {
|
|
4400
|
+
this.onSymbolRenderChange(newSymbols);
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
setLegendSymbol(symbolRenderIndexes) {
|
|
4407
|
+
const intervals = this._consolidateIntervals(symbolRenderIndexes);
|
|
4408
|
+
if (!intervals.length) {
|
|
4409
|
+
this._hideLayer();
|
|
4410
|
+
}
|
|
4411
|
+
if (this.layer.updateLayer) {
|
|
4412
|
+
this.layer.updateLayer({
|
|
4413
|
+
params: __spreadValues$j({}, createLayerSymbolParam(this.resourceId, intervals))
|
|
4414
|
+
});
|
|
4415
|
+
}
|
|
4416
|
+
if (intervals.length) {
|
|
4417
|
+
this._showLayer();
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
_hideLayer() {
|
|
4421
|
+
if (this.layer.options.id) {
|
|
4422
|
+
this.webMap.mapAdapter.hideLayer(this.layer.layer);
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
_showLayer() {
|
|
4426
|
+
if (this.layer.options.id) {
|
|
4427
|
+
if (this.layerVisibility) {
|
|
4428
|
+
this.webMap.showLayer(this.layer.options.id, { silent: true });
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
_consolidateIntervals(symbols) {
|
|
4433
|
+
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
4434
|
+
const intervals = [];
|
|
4435
|
+
let start = sortedSymbols[0];
|
|
4436
|
+
let end = start;
|
|
4437
|
+
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
4438
|
+
if (sortedSymbols[i] === end + 1) {
|
|
4439
|
+
end = sortedSymbols[i];
|
|
4440
|
+
} else {
|
|
4441
|
+
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
4442
|
+
start = sortedSymbols[i];
|
|
4443
|
+
end = start;
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
return intervals;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
|
|
4288
4450
|
var __defProp$q = Object.defineProperty;
|
|
4289
4451
|
var __defProps$b = Object.defineProperties;
|
|
4290
4452
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
@@ -4326,14 +4488,23 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
4326
4488
|
});
|
|
4327
4489
|
};
|
|
4328
4490
|
const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
4329
|
-
constructor(
|
|
4491
|
+
constructor({
|
|
4492
|
+
webMap,
|
|
4493
|
+
item,
|
|
4494
|
+
options,
|
|
4495
|
+
connector,
|
|
4496
|
+
parent,
|
|
4497
|
+
noInit
|
|
4498
|
+
}) {
|
|
4330
4499
|
super(__spreadValues$i(__spreadValues$i({}, _NgwWebmapItem.options), options));
|
|
4331
|
-
this.webMap = webMap;
|
|
4332
4500
|
__publicField$h(this, "item");
|
|
4501
|
+
__publicField$h(this, "webMap");
|
|
4333
4502
|
__publicField$h(this, "connector");
|
|
4334
4503
|
__publicField$h(this, "layer");
|
|
4504
|
+
__publicField$h(this, "legend");
|
|
4335
4505
|
__publicField$h(this, "emitter", new EventEmitter());
|
|
4336
4506
|
__publicField$h(this, "_rootDescendantsCount", 0);
|
|
4507
|
+
this.webMap = webMap;
|
|
4337
4508
|
if (connector) {
|
|
4338
4509
|
this.connector = connector;
|
|
4339
4510
|
}
|
|
@@ -4356,14 +4527,14 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4356
4527
|
}
|
|
4357
4528
|
static create(webMap, item, options, connector, parent) {
|
|
4358
4529
|
return __async$j(this, null, function* () {
|
|
4359
|
-
const ngwWebmapItem = new _NgwWebmapItem(
|
|
4530
|
+
const ngwWebmapItem = new _NgwWebmapItem({
|
|
4360
4531
|
webMap,
|
|
4361
4532
|
item,
|
|
4362
4533
|
options,
|
|
4363
4534
|
connector,
|
|
4364
4535
|
parent,
|
|
4365
|
-
true
|
|
4366
|
-
);
|
|
4536
|
+
noInit: true
|
|
4537
|
+
});
|
|
4367
4538
|
yield ngwWebmapItem._init(item);
|
|
4368
4539
|
return ngwWebmapItem;
|
|
4369
4540
|
});
|
|
@@ -4385,22 +4556,34 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4385
4556
|
}
|
|
4386
4557
|
getLegend(options) {
|
|
4387
4558
|
return __async$j(this, null, function* () {
|
|
4388
|
-
var _a;
|
|
4559
|
+
var _a, _b;
|
|
4389
4560
|
const id = (_a = this.layer) == null ? void 0 : _a.id;
|
|
4390
4561
|
if (id !== void 0) {
|
|
4391
4562
|
const connector = this.connector;
|
|
4392
4563
|
if (connector && "resourceId" in this.item) {
|
|
4393
|
-
const
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4564
|
+
const resourceId = Number(this.item.resourceId);
|
|
4565
|
+
if (this.item.item_type === "layer") {
|
|
4566
|
+
if (this.layer) {
|
|
4567
|
+
const legend = new Legend({
|
|
4568
|
+
connector: this.connector,
|
|
4569
|
+
layerId: id,
|
|
4570
|
+
layer: this.layer,
|
|
4571
|
+
resourceId,
|
|
4572
|
+
webMap: this.webMap,
|
|
4573
|
+
legendSymbols: (_b = this.item.legend_symbols) != null ? _b : void 0,
|
|
4574
|
+
onSymbolRenderChange: (indexes) => {
|
|
4575
|
+
this.webMap.emitter.emit("event-symbol-render:change", {
|
|
4576
|
+
layerId: id,
|
|
4577
|
+
resourceId,
|
|
4578
|
+
indexes
|
|
4579
|
+
});
|
|
4580
|
+
}
|
|
4581
|
+
});
|
|
4582
|
+
yield legend.create(options);
|
|
4583
|
+
return [legend];
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
return [];
|
|
4404
4587
|
}
|
|
4405
4588
|
}
|
|
4406
4589
|
return [];
|
|
@@ -4455,13 +4638,13 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4455
4638
|
if (group.children && group.children.length) {
|
|
4456
4639
|
const children = this.getChildren(group);
|
|
4457
4640
|
for (const child of children) {
|
|
4458
|
-
const childItem = new this.constructor(
|
|
4459
|
-
this.webMap,
|
|
4460
|
-
child,
|
|
4461
|
-
this.options,
|
|
4462
|
-
this.connector,
|
|
4463
|
-
this
|
|
4464
|
-
);
|
|
4641
|
+
const childItem = new this.constructor({
|
|
4642
|
+
webMap: this.webMap,
|
|
4643
|
+
item: child,
|
|
4644
|
+
options: this.options,
|
|
4645
|
+
connector: this.connector,
|
|
4646
|
+
parent: this
|
|
4647
|
+
});
|
|
4465
4648
|
this.tree.addChild(childItem);
|
|
4466
4649
|
}
|
|
4467
4650
|
}
|
|
@@ -4489,6 +4672,15 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4489
4672
|
}
|
|
4490
4673
|
if (adapter) {
|
|
4491
4674
|
return this.webMap.addLayer(adapter, options).then((newLayer) => {
|
|
4675
|
+
this.webMap.emitter.on("layer:toggle", (e) => {
|
|
4676
|
+
if (e.id === newLayer.id) {
|
|
4677
|
+
const enabled = this.properties.get("visibility");
|
|
4678
|
+
const mapVisible = this.webMap.isLayerVisible(newLayer);
|
|
4679
|
+
if (enabled !== mapVisible) {
|
|
4680
|
+
this.properties.set("visibility", mapVisible);
|
|
4681
|
+
}
|
|
4682
|
+
}
|
|
4683
|
+
});
|
|
4492
4684
|
setNewLayer(newLayer);
|
|
4493
4685
|
});
|
|
4494
4686
|
}
|
|
@@ -4791,12 +4983,12 @@ class NgwWebmapLayerAdapter {
|
|
|
4791
4983
|
headers,
|
|
4792
4984
|
drawOrderEnabled: (_a = webmap.draw_order_enabled) != null ? _a : false
|
|
4793
4985
|
});
|
|
4794
|
-
const layer = new this.NgwWebmapItem(
|
|
4795
|
-
this.options.webMap,
|
|
4796
|
-
webmap.root_item,
|
|
4986
|
+
const layer = new this.NgwWebmapItem({
|
|
4987
|
+
webMap: this.options.webMap,
|
|
4988
|
+
item: webmap.root_item,
|
|
4797
4989
|
options,
|
|
4798
4990
|
connector
|
|
4799
|
-
);
|
|
4991
|
+
});
|
|
4800
4992
|
layer.emitter.on("init", () => {
|
|
4801
4993
|
resolve(layer);
|
|
4802
4994
|
});
|
|
@@ -4862,6 +5054,7 @@ class NgwWebmapLayerAdapter {
|
|
|
4862
5054
|
}
|
|
4863
5055
|
}
|
|
4864
5056
|
_updateItemsParams(item, webMap, data) {
|
|
5057
|
+
var _a;
|
|
4865
5058
|
if (item) {
|
|
4866
5059
|
if (item.item_type === "group" || item.item_type === "root") {
|
|
4867
5060
|
if ("children" in item && item.children) {
|
|
@@ -4894,6 +5087,9 @@ class NgwWebmapLayerAdapter {
|
|
|
4894
5087
|
item = __spreadValues$h(__spreadValues$h({}, layerItem), layerAdapterOptions);
|
|
4895
5088
|
}
|
|
4896
5089
|
}
|
|
5090
|
+
if (typeof ((_a = this.options.nativeOptions) == null ? void 0 : _a.beforeItemCreated) === "function") {
|
|
5091
|
+
item = this.options.nativeOptions.beforeItemCreated(item);
|
|
5092
|
+
}
|
|
4897
5093
|
return item;
|
|
4898
5094
|
}
|
|
4899
5095
|
}
|
|
@@ -5779,42 +5975,6 @@ var __async$c = (__this, __arguments, generator) => {
|
|
|
5779
5975
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5780
5976
|
});
|
|
5781
5977
|
};
|
|
5782
|
-
class Legend {
|
|
5783
|
-
constructor({
|
|
5784
|
-
layerId,
|
|
5785
|
-
legend,
|
|
5786
|
-
onSymbolRenderChange
|
|
5787
|
-
}) {
|
|
5788
|
-
__publicField$c(this, "layerId");
|
|
5789
|
-
__publicField$c(this, "legend");
|
|
5790
|
-
__publicField$c(this, "onSymbolRenderChange");
|
|
5791
|
-
this.layerId = layerId;
|
|
5792
|
-
this.legend = this.createLegend(legend);
|
|
5793
|
-
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
5794
|
-
}
|
|
5795
|
-
createLegend(items) {
|
|
5796
|
-
return items.map((params) => __spreadProps$6(__spreadValues$b({}, params), {
|
|
5797
|
-
/** @deprecated use display_name instead */
|
|
5798
|
-
name: params.display_name,
|
|
5799
|
-
/** @deprecated use icon instead */
|
|
5800
|
-
symbol: params.icon
|
|
5801
|
-
}));
|
|
5802
|
-
}
|
|
5803
|
-
setSymbolRender(symbolIndex, status) {
|
|
5804
|
-
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
5805
|
-
if (legendItem) {
|
|
5806
|
-
const render = legendItem.render;
|
|
5807
|
-
if (render !== status) {
|
|
5808
|
-
legendItem.render = status;
|
|
5809
|
-
if (this.onSymbolRenderChange) {
|
|
5810
|
-
this.onSymbolRenderChange(
|
|
5811
|
-
this.legend.filter((l) => l.render).map((l) => l.index)
|
|
5812
|
-
);
|
|
5813
|
-
}
|
|
5814
|
-
}
|
|
5815
|
-
}
|
|
5816
|
-
}
|
|
5817
|
-
}
|
|
5818
5978
|
function createRasterAdapter(_0) {
|
|
5819
5979
|
return __async$c(this, arguments, function* ({
|
|
5820
5980
|
layerOptions,
|
|
@@ -5850,8 +6010,8 @@ function createRasterAdapter(_0) {
|
|
|
5850
6010
|
this.map = map;
|
|
5851
6011
|
__publicField$c(this, "item", item);
|
|
5852
6012
|
__publicField$c(this, "resourceId", resourceId);
|
|
5853
|
-
__publicField$c(this, "
|
|
5854
|
-
__publicField$c(this, "
|
|
6013
|
+
__publicField$c(this, "blocked", false);
|
|
6014
|
+
__publicField$c(this, "layerVisibility");
|
|
5855
6015
|
const opt = ngwApiToAdapterOptions({
|
|
5856
6016
|
options: layerOptions,
|
|
5857
6017
|
webMap,
|
|
@@ -5872,24 +6032,6 @@ function createRasterAdapter(_0) {
|
|
|
5872
6032
|
addLayer(addOptions) {
|
|
5873
6033
|
return super.addLayer(__spreadValues$b(__spreadValues$b({}, this.options), addOptions));
|
|
5874
6034
|
}
|
|
5875
|
-
showLayer() {
|
|
5876
|
-
this._layerVisibility = true;
|
|
5877
|
-
if (!this._blocked) {
|
|
5878
|
-
if (super.showLayer) {
|
|
5879
|
-
super.showLayer(this.layer);
|
|
5880
|
-
} else if (this.layer) {
|
|
5881
|
-
webMap.mapAdapter.showLayer(this.layer);
|
|
5882
|
-
}
|
|
5883
|
-
}
|
|
5884
|
-
}
|
|
5885
|
-
hideLayer() {
|
|
5886
|
-
this._layerVisibility = false;
|
|
5887
|
-
if (super.hideLayer) {
|
|
5888
|
-
super.hideLayer(this.layer);
|
|
5889
|
-
} else if (this.layer) {
|
|
5890
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5891
|
-
}
|
|
5892
|
-
}
|
|
5893
6035
|
getIdentificationIds() {
|
|
5894
6036
|
return __async$c(this, null, function* () {
|
|
5895
6037
|
if (this.item) {
|
|
@@ -5915,59 +6057,16 @@ function createRasterAdapter(_0) {
|
|
|
5915
6057
|
}, options));
|
|
5916
6058
|
const legend = new Legend({
|
|
5917
6059
|
layerId: id,
|
|
5918
|
-
|
|
5919
|
-
|
|
6060
|
+
layer: this,
|
|
6061
|
+
resourceId,
|
|
6062
|
+
webMap,
|
|
6063
|
+
legend: ngwLegend
|
|
5920
6064
|
});
|
|
5921
6065
|
return [legend];
|
|
5922
6066
|
}
|
|
5923
6067
|
return [];
|
|
5924
6068
|
});
|
|
5925
6069
|
}
|
|
5926
|
-
_hideLayer() {
|
|
5927
|
-
if (this.options.id) {
|
|
5928
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5929
|
-
}
|
|
5930
|
-
}
|
|
5931
|
-
_showLayer() {
|
|
5932
|
-
if (this.options.id) {
|
|
5933
|
-
if (this._layerVisibility) {
|
|
5934
|
-
webMap.showLayer(this.options.id, { silent: true });
|
|
5935
|
-
}
|
|
5936
|
-
}
|
|
5937
|
-
}
|
|
5938
|
-
_setLegendSymbol(renderIndexes) {
|
|
5939
|
-
const intervals = this._consolidateIntervals(renderIndexes);
|
|
5940
|
-
if (!intervals.length) {
|
|
5941
|
-
this._hideLayer();
|
|
5942
|
-
this._blocked = true;
|
|
5943
|
-
} else {
|
|
5944
|
-
this._blocked = false;
|
|
5945
|
-
this._showLayer();
|
|
5946
|
-
}
|
|
5947
|
-
if (this.updateLayer) {
|
|
5948
|
-
this.updateLayer({
|
|
5949
|
-
params: {
|
|
5950
|
-
[`symbols[${resourceId}]`]: intervals.join(",") || void 0
|
|
5951
|
-
}
|
|
5952
|
-
});
|
|
5953
|
-
}
|
|
5954
|
-
}
|
|
5955
|
-
_consolidateIntervals(symbols) {
|
|
5956
|
-
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
5957
|
-
const intervals = [];
|
|
5958
|
-
let start = sortedSymbols[0];
|
|
5959
|
-
let end = start;
|
|
5960
|
-
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
5961
|
-
if (sortedSymbols[i] === end + 1) {
|
|
5962
|
-
end = sortedSymbols[i];
|
|
5963
|
-
} else {
|
|
5964
|
-
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
5965
|
-
start = sortedSymbols[i];
|
|
5966
|
-
end = start;
|
|
5967
|
-
}
|
|
5968
|
-
}
|
|
5969
|
-
return intervals;
|
|
5970
|
-
}
|
|
5971
6070
|
};
|
|
5972
6071
|
} else {
|
|
5973
6072
|
throw new Error(adapter + " not supported yet. Only TILE");
|
|
@@ -6329,16 +6428,25 @@ class IdentifyItem {
|
|
|
6329
6428
|
});
|
|
6330
6429
|
}
|
|
6331
6430
|
resource(opt) {
|
|
6431
|
+
return __async$9(this, null, function* () {
|
|
6432
|
+
const composite = yield this.composite(opt);
|
|
6433
|
+
return composite.feature_layer;
|
|
6434
|
+
});
|
|
6435
|
+
}
|
|
6436
|
+
composite(opt) {
|
|
6332
6437
|
return __async$9(this, null, function* () {
|
|
6333
6438
|
if (this._resource && this._resource.feature_layer) {
|
|
6334
|
-
return this._resource
|
|
6439
|
+
return this._resource;
|
|
6335
6440
|
}
|
|
6336
6441
|
const resp = yield this.connector.getResource(this.layerId, opt);
|
|
6337
|
-
if (!
|
|
6338
|
-
throw new Error("Resource
|
|
6442
|
+
if (!resp) {
|
|
6443
|
+
throw new Error("Resource does not exist");
|
|
6444
|
+
}
|
|
6445
|
+
if (!resp.feature_layer) {
|
|
6446
|
+
throw new Error("Resource is not a vector layer");
|
|
6339
6447
|
}
|
|
6340
6448
|
this._resource = resp;
|
|
6341
|
-
return resp
|
|
6449
|
+
return resp;
|
|
6342
6450
|
});
|
|
6343
6451
|
}
|
|
6344
6452
|
getBounds(opt) {
|
|
@@ -6351,7 +6459,7 @@ class IdentifyItem {
|
|
|
6351
6459
|
resourceId: this.layerId
|
|
6352
6460
|
}, opt));
|
|
6353
6461
|
}
|
|
6354
|
-
geojson(options) {
|
|
6462
|
+
geojson(options = {}) {
|
|
6355
6463
|
if (this._geojson) {
|
|
6356
6464
|
return Promise.resolve(this._geojson);
|
|
6357
6465
|
}
|
|
@@ -10204,7 +10312,8 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
10204
10312
|
const identFunc = typeof layer.getIdentificationIds === "function" ? layer.getIdentificationIds : false;
|
|
10205
10313
|
const interactive = (_a = layer.options.interactive) != null ? _a : true;
|
|
10206
10314
|
if (identFunc && layer.options.selectable && interactive && this.isLayerVisible(layer)) {
|
|
10207
|
-
|
|
10315
|
+
const layerIds = identFunc.call(layer);
|
|
10316
|
+
promises.push(layerIds);
|
|
10208
10317
|
}
|
|
10209
10318
|
}
|
|
10210
10319
|
const getIdsPromise = Promise.all(promises);
|