@nextgis/ngw-map 3.0.0-alpha.16 → 3.0.0-alpha.18
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 +652 -545
- 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 +652 -545
- 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 +9 -9
|
@@ -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.17; 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.17",
|
|
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"];
|
|
@@ -2737,7 +2737,7 @@ function fetchNgwLayerItemExtent({
|
|
|
2737
2737
|
id: Number(resourceId),
|
|
2738
2738
|
fid: featureId
|
|
2739
2739
|
}).get({ cache, signal }).then((resp) => {
|
|
2740
|
-
if (resp) {
|
|
2740
|
+
if (resp && resp.extent) {
|
|
2741
2741
|
const { maxLat, maxLon, minLat, minLon } = resp.extent;
|
|
2742
2742
|
const extentArray = [minLon, minLat, maxLon, maxLat];
|
|
2743
2743
|
return extentArray;
|
|
@@ -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 {
|
|
@@ -3189,7 +3189,8 @@ var __async$m = (__this, __arguments, generator) => {
|
|
|
3189
3189
|
};
|
|
3190
3190
|
const FEATURE_REQUEST_PARAMS = {
|
|
3191
3191
|
srs: 4326,
|
|
3192
|
-
geom_format: "geojson"
|
|
3192
|
+
geom_format: "geojson",
|
|
3193
|
+
dt_format: "iso"
|
|
3193
3194
|
};
|
|
3194
3195
|
function createGeoJsonFeature(item) {
|
|
3195
3196
|
const geometry = item.geom;
|
|
@@ -3233,7 +3234,7 @@ function paramListToQuery(paramList) {
|
|
|
3233
3234
|
);
|
|
3234
3235
|
}
|
|
3235
3236
|
function createFeatureFieldFilterQueries(opt) {
|
|
3236
|
-
return __async$
|
|
3237
|
+
return __async$n(this, null, function* () {
|
|
3237
3238
|
const queries = getQueries(opt);
|
|
3238
3239
|
const itemsParts = yield Promise.all(queries);
|
|
3239
3240
|
const ids = [];
|
|
@@ -3277,13 +3278,13 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3277
3278
|
for (const f of filters_) {
|
|
3278
3279
|
if (isPropertyFilter(f)) {
|
|
3279
3280
|
_queries.push(
|
|
3280
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3281
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3281
3282
|
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
3282
3283
|
}))
|
|
3283
3284
|
);
|
|
3284
3285
|
} else {
|
|
3285
3286
|
getQueries(
|
|
3286
|
-
__spreadProps$
|
|
3287
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3287
3288
|
filters: f
|
|
3288
3289
|
}),
|
|
3289
3290
|
_queries,
|
|
@@ -3304,7 +3305,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3304
3305
|
if (propertiesFilterList.length) {
|
|
3305
3306
|
for (const x of propertiesFilterList) {
|
|
3306
3307
|
getQueries(
|
|
3307
|
-
__spreadProps$
|
|
3308
|
+
__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3308
3309
|
filters: x
|
|
3309
3310
|
}),
|
|
3310
3311
|
_queries,
|
|
@@ -3313,7 +3314,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
3313
3314
|
}
|
|
3314
3315
|
} else {
|
|
3315
3316
|
_queries.push(
|
|
3316
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
3317
|
+
fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$q({}, opt), {
|
|
3317
3318
|
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
3318
3319
|
}))
|
|
3319
3320
|
);
|
|
@@ -3329,7 +3330,7 @@ function createWktFromCoordArray(coord) {
|
|
|
3329
3330
|
return `POLYGON((${polygon.join(", ")}))`;
|
|
3330
3331
|
}
|
|
3331
3332
|
function fetchNgwLayerItemsRequest(options) {
|
|
3332
|
-
const params = __spreadValues$
|
|
3333
|
+
const params = __spreadValues$q({}, FEATURE_REQUEST_PARAMS);
|
|
3333
3334
|
const {
|
|
3334
3335
|
limit,
|
|
3335
3336
|
query,
|
|
@@ -3367,7 +3368,7 @@ function fetchNgwLayerItemsRequest(options) {
|
|
|
3367
3368
|
if (paramList) {
|
|
3368
3369
|
Object.assign(params, paramListToQuery(paramList));
|
|
3369
3370
|
}
|
|
3370
|
-
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 });
|
|
3371
3372
|
}
|
|
3372
3373
|
|
|
3373
3374
|
function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
@@ -3396,26 +3397,26 @@ function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
|
3396
3397
|
return fields;
|
|
3397
3398
|
}
|
|
3398
3399
|
|
|
3399
|
-
var __defProp$
|
|
3400
|
-
var __defProps$
|
|
3401
|
-
var __getOwnPropDescs$
|
|
3402
|
-
var __getOwnPropSymbols$
|
|
3403
|
-
var __hasOwnProp$
|
|
3404
|
-
var __propIsEnum$
|
|
3405
|
-
var __defNormalProp$
|
|
3406
|
-
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) => {
|
|
3407
3408
|
for (var prop in b || (b = {}))
|
|
3408
|
-
if (__hasOwnProp$
|
|
3409
|
-
__defNormalProp$
|
|
3410
|
-
if (__getOwnPropSymbols$
|
|
3411
|
-
for (var prop of __getOwnPropSymbols$
|
|
3412
|
-
if (__propIsEnum$
|
|
3413
|
-
__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]);
|
|
3414
3415
|
}
|
|
3415
3416
|
return a;
|
|
3416
3417
|
};
|
|
3417
|
-
var __spreadProps$
|
|
3418
|
-
var __async$
|
|
3418
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
3419
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
3419
3420
|
return new Promise((resolve, reject) => {
|
|
3420
3421
|
var fulfilled = (value) => {
|
|
3421
3422
|
try {
|
|
@@ -3436,17 +3437,17 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
3436
3437
|
});
|
|
3437
3438
|
};
|
|
3438
3439
|
function fetchNgwLayerItems(options) {
|
|
3439
|
-
return __async$
|
|
3440
|
+
return __async$m(this, null, function* () {
|
|
3440
3441
|
var _a;
|
|
3441
3442
|
const filters = options.filters;
|
|
3442
3443
|
if (filters) {
|
|
3443
|
-
let data = yield createFeatureFieldFilterQueries(__spreadProps$
|
|
3444
|
+
let data = yield createFeatureFieldFilterQueries(__spreadProps$e(__spreadValues$p({}, options), {
|
|
3444
3445
|
filters
|
|
3445
3446
|
}));
|
|
3446
3447
|
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
|
|
3447
3448
|
if (clientFilterValidate) {
|
|
3448
3449
|
data = data.filter((y) => {
|
|
3449
|
-
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$
|
|
3450
|
+
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$e(__spreadValues$p({}, y.fields), {
|
|
3450
3451
|
id: y.id
|
|
3451
3452
|
}));
|
|
3452
3453
|
const result = propertiesFilter(fields, filters);
|
|
@@ -3564,26 +3565,26 @@ function ngwApiToAdapterOptions({
|
|
|
3564
3565
|
}
|
|
3565
3566
|
}
|
|
3566
3567
|
|
|
3567
|
-
var __defProp$
|
|
3568
|
-
var __defProps$
|
|
3569
|
-
var __getOwnPropDescs$
|
|
3570
|
-
var __getOwnPropSymbols$
|
|
3571
|
-
var __hasOwnProp$
|
|
3572
|
-
var __propIsEnum$
|
|
3573
|
-
var __defNormalProp$
|
|
3574
|
-
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) => {
|
|
3575
3576
|
for (var prop in b || (b = {}))
|
|
3576
|
-
if (__hasOwnProp$
|
|
3577
|
-
__defNormalProp$
|
|
3578
|
-
if (__getOwnPropSymbols$
|
|
3579
|
-
for (var prop of __getOwnPropSymbols$
|
|
3580
|
-
if (__propIsEnum$
|
|
3581
|
-
__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]);
|
|
3582
3583
|
}
|
|
3583
3584
|
return a;
|
|
3584
3585
|
};
|
|
3585
|
-
var __spreadProps$
|
|
3586
|
-
var __async$
|
|
3586
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
3587
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
3587
3588
|
return new Promise((resolve, reject) => {
|
|
3588
3589
|
var fulfilled = (value) => {
|
|
3589
3590
|
try {
|
|
@@ -3604,56 +3605,56 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
3604
3605
|
});
|
|
3605
3606
|
};
|
|
3606
3607
|
function fetchNgwLayerItem(options) {
|
|
3607
|
-
return __async$
|
|
3608
|
-
const params = __spreadValues$
|
|
3608
|
+
return __async$l(this, null, function* () {
|
|
3609
|
+
const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
|
|
3609
3610
|
updateItemRequestParam(params, options);
|
|
3610
3611
|
const resp = yield options.connector.route("feature_layer.feature.item", {
|
|
3611
3612
|
id: Number(options.resourceId),
|
|
3612
3613
|
fid: options.featureId
|
|
3613
|
-
}).get(__spreadProps$
|
|
3614
|
-
const toGeojson = () => __async$
|
|
3614
|
+
}).get(__spreadProps$d(__spreadValues$o({}, options), { query: params }));
|
|
3615
|
+
const toGeojson = () => __async$l(this, null, function* () {
|
|
3615
3616
|
if (resp.geom) {
|
|
3616
3617
|
return createGeoJsonFeature(resp);
|
|
3617
3618
|
} else {
|
|
3618
|
-
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$
|
|
3619
|
+
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$d(__spreadValues$o({}, options), {
|
|
3619
3620
|
geom: true,
|
|
3620
3621
|
fields: null,
|
|
3621
3622
|
extensions: null
|
|
3622
3623
|
}));
|
|
3623
3624
|
const geom = onlyGeomItem.geom;
|
|
3624
|
-
return createGeoJsonFeature(__spreadProps$
|
|
3625
|
+
return createGeoJsonFeature(__spreadProps$d(__spreadValues$o({}, resp), { geom }));
|
|
3625
3626
|
}
|
|
3626
3627
|
});
|
|
3627
|
-
return __spreadProps$
|
|
3628
|
+
return __spreadProps$d(__spreadValues$o({}, resp), {
|
|
3628
3629
|
toGeojson
|
|
3629
3630
|
});
|
|
3630
3631
|
});
|
|
3631
3632
|
}
|
|
3632
3633
|
|
|
3633
|
-
var __defProp$
|
|
3634
|
-
var __getOwnPropSymbols$
|
|
3635
|
-
var __hasOwnProp$
|
|
3636
|
-
var __propIsEnum$
|
|
3637
|
-
var __defNormalProp$
|
|
3638
|
-
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) => {
|
|
3639
3640
|
for (var prop in b || (b = {}))
|
|
3640
|
-
if (__hasOwnProp$
|
|
3641
|
-
__defNormalProp$
|
|
3642
|
-
if (__getOwnPropSymbols$
|
|
3643
|
-
for (var prop of __getOwnPropSymbols$
|
|
3644
|
-
if (__propIsEnum$
|
|
3645
|
-
__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]);
|
|
3646
3647
|
}
|
|
3647
3648
|
return a;
|
|
3648
3649
|
};
|
|
3649
|
-
var __publicField$
|
|
3650
|
+
var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3650
3651
|
class BookmarkItem {
|
|
3651
3652
|
constructor(options) {
|
|
3652
3653
|
this.options = options;
|
|
3653
|
-
__publicField$
|
|
3654
|
-
__publicField$
|
|
3655
|
-
__publicField$
|
|
3656
|
-
__publicField$
|
|
3654
|
+
__publicField$o(this, "name");
|
|
3655
|
+
__publicField$o(this, "resourceId");
|
|
3656
|
+
__publicField$o(this, "item");
|
|
3657
|
+
__publicField$o(this, "_extent");
|
|
3657
3658
|
this.resourceId = options.resourceId;
|
|
3658
3659
|
const item = options.item;
|
|
3659
3660
|
this.item = item;
|
|
@@ -3671,17 +3672,19 @@ class BookmarkItem {
|
|
|
3671
3672
|
id: this.resourceId,
|
|
3672
3673
|
fid: this.item.id
|
|
3673
3674
|
}).get(opt).then((resp) => {
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3675
|
+
if (resp.extent) {
|
|
3676
|
+
const { minLat, minLon, maxLat, maxLon } = resp.extent;
|
|
3677
|
+
const lonLat = [minLon, minLat, maxLon, maxLat];
|
|
3678
|
+
this._extent = lonLat;
|
|
3679
|
+
return lonLat;
|
|
3680
|
+
}
|
|
3678
3681
|
});
|
|
3679
3682
|
}
|
|
3680
3683
|
geoJson(opt) {
|
|
3681
3684
|
if (this.item.geom) {
|
|
3682
3685
|
return Promise.resolve(createGeoJsonFeature(this.item));
|
|
3683
3686
|
} else {
|
|
3684
|
-
return fetchNgwLayerItem(__spreadValues$
|
|
3687
|
+
return fetchNgwLayerItem(__spreadValues$n({
|
|
3685
3688
|
resourceId: this.resourceId,
|
|
3686
3689
|
featureId: this.item.id,
|
|
3687
3690
|
connector: this.options.connector,
|
|
@@ -3699,19 +3702,19 @@ class BookmarkItem {
|
|
|
3699
3702
|
|
|
3700
3703
|
const WEBMAP_BASELAYER_ID_PREFIX = "webmap-baselayer";
|
|
3701
3704
|
|
|
3702
|
-
var __defProp$
|
|
3703
|
-
var __defNormalProp$
|
|
3704
|
-
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);
|
|
3705
3708
|
class BaseProperty {
|
|
3706
3709
|
constructor(name, item, options) {
|
|
3707
|
-
__publicField$
|
|
3708
|
-
__publicField$
|
|
3709
|
-
__publicField$
|
|
3710
|
-
__publicField$
|
|
3711
|
-
__publicField$
|
|
3712
|
-
__publicField$
|
|
3713
|
-
__publicField$
|
|
3714
|
-
__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");
|
|
3715
3718
|
this.item = item;
|
|
3716
3719
|
this.options = Object.assign({}, options);
|
|
3717
3720
|
this.name = name;
|
|
@@ -3808,26 +3811,26 @@ class BaseProperty {
|
|
|
3808
3811
|
}
|
|
3809
3812
|
}
|
|
3810
3813
|
|
|
3811
|
-
var __defProp$
|
|
3812
|
-
var __getOwnPropSymbols$
|
|
3813
|
-
var __hasOwnProp$
|
|
3814
|
-
var __propIsEnum$
|
|
3815
|
-
var __defNormalProp$
|
|
3816
|
-
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) => {
|
|
3817
3820
|
for (var prop in b || (b = {}))
|
|
3818
|
-
if (__hasOwnProp$
|
|
3819
|
-
__defNormalProp$
|
|
3820
|
-
if (__getOwnPropSymbols$
|
|
3821
|
-
for (var prop of __getOwnPropSymbols$
|
|
3822
|
-
if (__propIsEnum$
|
|
3823
|
-
__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]);
|
|
3824
3827
|
}
|
|
3825
3828
|
return a;
|
|
3826
3829
|
};
|
|
3827
|
-
var __publicField$
|
|
3830
|
+
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, key + "" , value);
|
|
3828
3831
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
3829
3832
|
constructor(name, item, options) {
|
|
3830
|
-
super(name, item, __spreadValues$
|
|
3833
|
+
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
3831
3834
|
this.set(this.get());
|
|
3832
3835
|
}
|
|
3833
3836
|
update(value, options) {
|
|
@@ -3923,7 +3926,7 @@ const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
|
3923
3926
|
const child = children[fry];
|
|
3924
3927
|
const property = child.properties && child.properties.property(this.name);
|
|
3925
3928
|
if (property) {
|
|
3926
|
-
property.set(value, __spreadValues$
|
|
3929
|
+
property.set(value, __spreadValues$m(__spreadValues$m({}, options), {
|
|
3927
3930
|
propagation: true,
|
|
3928
3931
|
bubble: false
|
|
3929
3932
|
}));
|
|
@@ -3932,7 +3935,7 @@ const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
|
3932
3935
|
}
|
|
3933
3936
|
}
|
|
3934
3937
|
};
|
|
3935
|
-
__publicField$
|
|
3938
|
+
__publicField$m(_CheckProperty, "options", {
|
|
3936
3939
|
hierarchy: true,
|
|
3937
3940
|
bubble: false,
|
|
3938
3941
|
propagation: false,
|
|
@@ -3941,31 +3944,31 @@ __publicField$l(_CheckProperty, "options", {
|
|
|
3941
3944
|
});
|
|
3942
3945
|
let CheckProperty = _CheckProperty;
|
|
3943
3946
|
|
|
3944
|
-
var __defProp$
|
|
3945
|
-
var __getOwnPropSymbols$
|
|
3946
|
-
var __hasOwnProp$
|
|
3947
|
-
var __propIsEnum$
|
|
3948
|
-
var __defNormalProp$
|
|
3949
|
-
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) => {
|
|
3950
3953
|
for (var prop in b || (b = {}))
|
|
3951
|
-
if (__hasOwnProp$
|
|
3952
|
-
__defNormalProp$
|
|
3953
|
-
if (__getOwnPropSymbols$
|
|
3954
|
-
for (var prop of __getOwnPropSymbols$
|
|
3955
|
-
if (__propIsEnum$
|
|
3956
|
-
__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]);
|
|
3957
3960
|
}
|
|
3958
3961
|
return a;
|
|
3959
3962
|
};
|
|
3960
|
-
var __publicField$
|
|
3963
|
+
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3961
3964
|
const BOOLEAN_TYPE = "boolean";
|
|
3962
3965
|
const STRING_TYPE = "string";
|
|
3963
3966
|
const _ItemProperties = class _ItemProperties {
|
|
3964
3967
|
constructor(item, propertiesList) {
|
|
3965
3968
|
this.item = item;
|
|
3966
|
-
__publicField$
|
|
3967
|
-
__publicField$
|
|
3968
|
-
__publicField$
|
|
3969
|
+
__publicField$l(this, "options", {});
|
|
3970
|
+
__publicField$l(this, "_properties", {});
|
|
3971
|
+
__publicField$l(this, "_propertiesList", []);
|
|
3969
3972
|
if (propertiesList) {
|
|
3970
3973
|
propertiesList.forEach(this._setPropertyHandler.bind(this));
|
|
3971
3974
|
}
|
|
@@ -4005,7 +4008,7 @@ const _ItemProperties = class _ItemProperties {
|
|
|
4005
4008
|
_setPropertyHandler(propOpt) {
|
|
4006
4009
|
const Handler = this._getHandler(propOpt);
|
|
4007
4010
|
if (Handler && propOpt.name) {
|
|
4008
|
-
const options = __spreadValues$
|
|
4011
|
+
const options = __spreadValues$l({}, propOpt);
|
|
4009
4012
|
this._properties[propOpt.name] = new Handler(
|
|
4010
4013
|
propOpt.name,
|
|
4011
4014
|
this.item,
|
|
@@ -4028,7 +4031,7 @@ const _ItemProperties = class _ItemProperties {
|
|
|
4028
4031
|
return Handler;
|
|
4029
4032
|
}
|
|
4030
4033
|
};
|
|
4031
|
-
__publicField$
|
|
4034
|
+
__publicField$l(_ItemProperties, "handlers", {
|
|
4032
4035
|
CheckProperty
|
|
4033
4036
|
});
|
|
4034
4037
|
let ItemProperties = _ItemProperties;
|
|
@@ -4135,14 +4138,14 @@ function treeEvery_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
|
|
|
4135
4138
|
return true;
|
|
4136
4139
|
}
|
|
4137
4140
|
|
|
4138
|
-
var __defProp$
|
|
4139
|
-
var __defNormalProp$
|
|
4140
|
-
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);
|
|
4141
4144
|
class TreeHelper {
|
|
4142
4145
|
constructor(item) {
|
|
4143
|
-
__publicField$
|
|
4144
|
-
__publicField$
|
|
4145
|
-
__publicField$
|
|
4146
|
+
__publicField$k(this, "item");
|
|
4147
|
+
__publicField$k(this, "_children", []);
|
|
4148
|
+
__publicField$k(this, "_parent");
|
|
4146
4149
|
this.item = item;
|
|
4147
4150
|
}
|
|
4148
4151
|
setParent(parent) {
|
|
@@ -4205,32 +4208,32 @@ class TreeHelper {
|
|
|
4205
4208
|
}
|
|
4206
4209
|
}
|
|
4207
4210
|
|
|
4208
|
-
var __defProp$
|
|
4209
|
-
var __getOwnPropSymbols$
|
|
4210
|
-
var __hasOwnProp$
|
|
4211
|
-
var __propIsEnum$
|
|
4212
|
-
var __defNormalProp$
|
|
4213
|
-
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) => {
|
|
4214
4217
|
for (var prop in b || (b = {}))
|
|
4215
|
-
if (__hasOwnProp$
|
|
4216
|
-
__defNormalProp$
|
|
4217
|
-
if (__getOwnPropSymbols$
|
|
4218
|
-
for (var prop of __getOwnPropSymbols$
|
|
4219
|
-
if (__propIsEnum$
|
|
4220
|
-
__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]);
|
|
4221
4224
|
}
|
|
4222
4225
|
return a;
|
|
4223
4226
|
};
|
|
4224
|
-
var __publicField$
|
|
4227
|
+
var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4225
4228
|
let ID$1 = 0;
|
|
4226
4229
|
class Item {
|
|
4227
4230
|
constructor(options) {
|
|
4228
|
-
__publicField$
|
|
4229
|
-
__publicField$
|
|
4230
|
-
__publicField$
|
|
4231
|
-
__publicField$
|
|
4231
|
+
__publicField$j(this, "options", {});
|
|
4232
|
+
__publicField$j(this, "properties");
|
|
4233
|
+
__publicField$j(this, "tree");
|
|
4234
|
+
__publicField$j(this, "id", ID$1);
|
|
4232
4235
|
ID$1 += 1;
|
|
4233
|
-
this.options = __spreadValues$
|
|
4236
|
+
this.options = __spreadValues$k({}, options);
|
|
4234
4237
|
this.tree = new TreeHelper(this);
|
|
4235
4238
|
}
|
|
4236
4239
|
initProperties() {
|
|
@@ -4282,6 +4285,161 @@ class WebmapLayerOpacityPropertyHandler extends BaseProperty {
|
|
|
4282
4285
|
}
|
|
4283
4286
|
}
|
|
4284
4287
|
|
|
4288
|
+
var __defProp$r = Object.defineProperty;
|
|
4289
|
+
var __defProps$c = Object.defineProperties;
|
|
4290
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
4291
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
4292
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
4293
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
4294
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4295
|
+
var __spreadValues$j = (a, b) => {
|
|
4296
|
+
for (var prop in b || (b = {}))
|
|
4297
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
4298
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4299
|
+
if (__getOwnPropSymbols$k)
|
|
4300
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
4301
|
+
if (__propIsEnum$k.call(b, prop))
|
|
4302
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
4303
|
+
}
|
|
4304
|
+
return a;
|
|
4305
|
+
};
|
|
4306
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
4307
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4308
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
4309
|
+
return new Promise((resolve, reject) => {
|
|
4310
|
+
var fulfilled = (value) => {
|
|
4311
|
+
try {
|
|
4312
|
+
step(generator.next(value));
|
|
4313
|
+
} catch (e) {
|
|
4314
|
+
reject(e);
|
|
4315
|
+
}
|
|
4316
|
+
};
|
|
4317
|
+
var rejected = (value) => {
|
|
4318
|
+
try {
|
|
4319
|
+
step(generator.throw(value));
|
|
4320
|
+
} catch (e) {
|
|
4321
|
+
reject(e);
|
|
4322
|
+
}
|
|
4323
|
+
};
|
|
4324
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
4325
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
4326
|
+
});
|
|
4327
|
+
};
|
|
4328
|
+
class Legend {
|
|
4329
|
+
constructor({
|
|
4330
|
+
legendSymbols,
|
|
4331
|
+
resourceId,
|
|
4332
|
+
connector,
|
|
4333
|
+
layerId,
|
|
4334
|
+
legend,
|
|
4335
|
+
webMap,
|
|
4336
|
+
layer,
|
|
4337
|
+
onSymbolRenderChange
|
|
4338
|
+
}) {
|
|
4339
|
+
__publicField$i(this, "layerId");
|
|
4340
|
+
__publicField$i(this, "layer");
|
|
4341
|
+
__publicField$i(this, "resourceId");
|
|
4342
|
+
__publicField$i(this, "legendSymbols", "expand");
|
|
4343
|
+
__publicField$i(this, "legend");
|
|
4344
|
+
// private blocked: boolean = false;
|
|
4345
|
+
__publicField$i(this, "layerVisibility", true);
|
|
4346
|
+
// private symbolRenderIndexes?: number[];
|
|
4347
|
+
__publicField$i(this, "onSymbolRenderChange");
|
|
4348
|
+
__publicField$i(this, "webMap");
|
|
4349
|
+
__publicField$i(this, "connector");
|
|
4350
|
+
if (legendSymbols) {
|
|
4351
|
+
this.legendSymbols = legendSymbols;
|
|
4352
|
+
}
|
|
4353
|
+
this.connector = connector;
|
|
4354
|
+
this.layer = layer;
|
|
4355
|
+
this.layerId = layerId;
|
|
4356
|
+
this.legend = this.createLegend(legend);
|
|
4357
|
+
this.resourceId = resourceId;
|
|
4358
|
+
this.webMap = webMap;
|
|
4359
|
+
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
4360
|
+
}
|
|
4361
|
+
attachLayer(layer) {
|
|
4362
|
+
this.layerId = String(layer.id);
|
|
4363
|
+
this.layer = layer;
|
|
4364
|
+
}
|
|
4365
|
+
create(options) {
|
|
4366
|
+
return __async$k(this, null, function* () {
|
|
4367
|
+
if (this.connector) {
|
|
4368
|
+
const ngwLegend = yield this.connector.route("render.legend_symbols", {
|
|
4369
|
+
id: this.resourceId
|
|
4370
|
+
}).get(__spreadValues$j({}, options));
|
|
4371
|
+
return this.createLegend(ngwLegend);
|
|
4372
|
+
}
|
|
4373
|
+
});
|
|
4374
|
+
}
|
|
4375
|
+
createLegend(items) {
|
|
4376
|
+
return items.map((params) => __spreadProps$c(__spreadValues$j({}, params), {
|
|
4377
|
+
/** @deprecated use display_name instead */
|
|
4378
|
+
name: params.display_name,
|
|
4379
|
+
/** @deprecated use icon instead */
|
|
4380
|
+
symbol: params.icon
|
|
4381
|
+
}));
|
|
4382
|
+
}
|
|
4383
|
+
setSymbolRender(symbolIndex, status) {
|
|
4384
|
+
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
4385
|
+
if (legendItem) {
|
|
4386
|
+
const render = legendItem.render;
|
|
4387
|
+
if (render !== status) {
|
|
4388
|
+
legendItem.render = status;
|
|
4389
|
+
const newSymbols = this.legend.filter((l) => l.render).map((l) => l.index);
|
|
4390
|
+
this.setLegendSymbol(newSymbols);
|
|
4391
|
+
if (this.onSymbolRenderChange) {
|
|
4392
|
+
this.onSymbolRenderChange(newSymbols);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4397
|
+
setLegendSymbol(symbolRenderIndexes) {
|
|
4398
|
+
const intervals = this._consolidateIntervals(symbolRenderIndexes);
|
|
4399
|
+
if (!intervals.length) {
|
|
4400
|
+
this._hideLayer();
|
|
4401
|
+
}
|
|
4402
|
+
if (this.layer.updateLayer) {
|
|
4403
|
+
this.layer.updateLayer({
|
|
4404
|
+
params: {
|
|
4405
|
+
[`symbols[${this.resourceId}]`]: intervals.join(",") || void 0
|
|
4406
|
+
}
|
|
4407
|
+
});
|
|
4408
|
+
}
|
|
4409
|
+
if (intervals.length) {
|
|
4410
|
+
this._showLayer();
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
_hideLayer() {
|
|
4414
|
+
if (this.layer.options.id) {
|
|
4415
|
+
this.webMap.mapAdapter.hideLayer(this.layer.layer);
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
_showLayer() {
|
|
4419
|
+
if (this.layer.options.id) {
|
|
4420
|
+
if (this.layerVisibility) {
|
|
4421
|
+
this.webMap.showLayer(this.layer.options.id, { silent: true });
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
_consolidateIntervals(symbols) {
|
|
4426
|
+
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
4427
|
+
const intervals = [];
|
|
4428
|
+
let start = sortedSymbols[0];
|
|
4429
|
+
let end = start;
|
|
4430
|
+
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
4431
|
+
if (sortedSymbols[i] === end + 1) {
|
|
4432
|
+
end = sortedSymbols[i];
|
|
4433
|
+
} else {
|
|
4434
|
+
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
4435
|
+
start = sortedSymbols[i];
|
|
4436
|
+
end = start;
|
|
4437
|
+
}
|
|
4438
|
+
}
|
|
4439
|
+
return intervals;
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4285
4443
|
var __defProp$q = Object.defineProperty;
|
|
4286
4444
|
var __defProps$b = Object.defineProperties;
|
|
4287
4445
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
@@ -4323,14 +4481,23 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
4323
4481
|
});
|
|
4324
4482
|
};
|
|
4325
4483
|
const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
4326
|
-
constructor(
|
|
4484
|
+
constructor({
|
|
4485
|
+
webMap,
|
|
4486
|
+
item,
|
|
4487
|
+
options,
|
|
4488
|
+
connector,
|
|
4489
|
+
parent,
|
|
4490
|
+
noInit
|
|
4491
|
+
}) {
|
|
4327
4492
|
super(__spreadValues$i(__spreadValues$i({}, _NgwWebmapItem.options), options));
|
|
4328
|
-
this.webMap = webMap;
|
|
4329
4493
|
__publicField$h(this, "item");
|
|
4494
|
+
__publicField$h(this, "webMap");
|
|
4330
4495
|
__publicField$h(this, "connector");
|
|
4331
4496
|
__publicField$h(this, "layer");
|
|
4497
|
+
__publicField$h(this, "legend");
|
|
4332
4498
|
__publicField$h(this, "emitter", new EventEmitter());
|
|
4333
4499
|
__publicField$h(this, "_rootDescendantsCount", 0);
|
|
4500
|
+
this.webMap = webMap;
|
|
4334
4501
|
if (connector) {
|
|
4335
4502
|
this.connector = connector;
|
|
4336
4503
|
}
|
|
@@ -4353,14 +4520,14 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4353
4520
|
}
|
|
4354
4521
|
static create(webMap, item, options, connector, parent) {
|
|
4355
4522
|
return __async$j(this, null, function* () {
|
|
4356
|
-
const ngwWebmapItem = new _NgwWebmapItem(
|
|
4523
|
+
const ngwWebmapItem = new _NgwWebmapItem({
|
|
4357
4524
|
webMap,
|
|
4358
4525
|
item,
|
|
4359
4526
|
options,
|
|
4360
4527
|
connector,
|
|
4361
4528
|
parent,
|
|
4362
|
-
true
|
|
4363
|
-
);
|
|
4529
|
+
noInit: true
|
|
4530
|
+
});
|
|
4364
4531
|
yield ngwWebmapItem._init(item);
|
|
4365
4532
|
return ngwWebmapItem;
|
|
4366
4533
|
});
|
|
@@ -4382,22 +4549,36 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4382
4549
|
}
|
|
4383
4550
|
getLegend(options) {
|
|
4384
4551
|
return __async$j(this, null, function* () {
|
|
4385
|
-
var _a;
|
|
4552
|
+
var _a, _b;
|
|
4386
4553
|
const id = (_a = this.layer) == null ? void 0 : _a.id;
|
|
4387
4554
|
if (id !== void 0) {
|
|
4388
4555
|
const connector = this.connector;
|
|
4389
4556
|
if (connector && "resourceId" in this.item) {
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4557
|
+
const resourceId = Number(this.item.resourceId);
|
|
4558
|
+
if (this.item.item_type === "layer") {
|
|
4559
|
+
const ngwLegend = yield connector.route("render.legend_symbols", {
|
|
4560
|
+
id: resourceId
|
|
4561
|
+
}).get(__spreadValues$i({}, options));
|
|
4562
|
+
if (this.layer && ngwLegend) {
|
|
4563
|
+
const legend = new Legend({
|
|
4564
|
+
layerId: id,
|
|
4565
|
+
legend: ngwLegend,
|
|
4566
|
+
layer: this.layer,
|
|
4567
|
+
resourceId,
|
|
4568
|
+
webMap: this.webMap,
|
|
4569
|
+
legendSymbols: (_b = this.item.legend_symbols) != null ? _b : void 0,
|
|
4570
|
+
onSymbolRenderChange: (indexes) => {
|
|
4571
|
+
this.webMap.emitter.emit("event-symbol-render:change", {
|
|
4572
|
+
layerId: id,
|
|
4573
|
+
resourceId,
|
|
4574
|
+
indexes
|
|
4575
|
+
});
|
|
4576
|
+
}
|
|
4577
|
+
});
|
|
4578
|
+
return [legend];
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4581
|
+
return [];
|
|
4401
4582
|
}
|
|
4402
4583
|
}
|
|
4403
4584
|
return [];
|
|
@@ -4452,13 +4633,13 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4452
4633
|
if (group.children && group.children.length) {
|
|
4453
4634
|
const children = this.getChildren(group);
|
|
4454
4635
|
for (const child of children) {
|
|
4455
|
-
const childItem = new this.constructor(
|
|
4456
|
-
this.webMap,
|
|
4457
|
-
child,
|
|
4458
|
-
this.options,
|
|
4459
|
-
this.connector,
|
|
4460
|
-
this
|
|
4461
|
-
);
|
|
4636
|
+
const childItem = new this.constructor({
|
|
4637
|
+
webMap: this.webMap,
|
|
4638
|
+
item: child,
|
|
4639
|
+
options: this.options,
|
|
4640
|
+
connector: this.connector,
|
|
4641
|
+
parent: this
|
|
4642
|
+
});
|
|
4462
4643
|
this.tree.addChild(childItem);
|
|
4463
4644
|
}
|
|
4464
4645
|
}
|
|
@@ -4486,6 +4667,15 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4486
4667
|
}
|
|
4487
4668
|
if (adapter) {
|
|
4488
4669
|
return this.webMap.addLayer(adapter, options).then((newLayer) => {
|
|
4670
|
+
this.webMap.emitter.on("layer:toggle", (e) => {
|
|
4671
|
+
if (e.id === newLayer.id) {
|
|
4672
|
+
const enabled = this.properties.get("visibility");
|
|
4673
|
+
const mapVisible = this.webMap.isLayerVisible(newLayer);
|
|
4674
|
+
if (enabled !== mapVisible) {
|
|
4675
|
+
this.properties.set("visibility", mapVisible);
|
|
4676
|
+
}
|
|
4677
|
+
}
|
|
4678
|
+
});
|
|
4489
4679
|
setNewLayer(newLayer);
|
|
4490
4680
|
});
|
|
4491
4681
|
}
|
|
@@ -4788,12 +4978,12 @@ class NgwWebmapLayerAdapter {
|
|
|
4788
4978
|
headers,
|
|
4789
4979
|
drawOrderEnabled: (_a = webmap.draw_order_enabled) != null ? _a : false
|
|
4790
4980
|
});
|
|
4791
|
-
const layer = new this.NgwWebmapItem(
|
|
4792
|
-
this.options.webMap,
|
|
4793
|
-
webmap.root_item,
|
|
4981
|
+
const layer = new this.NgwWebmapItem({
|
|
4982
|
+
webMap: this.options.webMap,
|
|
4983
|
+
item: webmap.root_item,
|
|
4794
4984
|
options,
|
|
4795
4985
|
connector
|
|
4796
|
-
);
|
|
4986
|
+
});
|
|
4797
4987
|
layer.emitter.on("init", () => {
|
|
4798
4988
|
resolve(layer);
|
|
4799
4989
|
});
|
|
@@ -4859,6 +5049,7 @@ class NgwWebmapLayerAdapter {
|
|
|
4859
5049
|
}
|
|
4860
5050
|
}
|
|
4861
5051
|
_updateItemsParams(item, webMap, data) {
|
|
5052
|
+
var _a;
|
|
4862
5053
|
if (item) {
|
|
4863
5054
|
if (item.item_type === "group" || item.item_type === "root") {
|
|
4864
5055
|
if ("children" in item && item.children) {
|
|
@@ -4891,6 +5082,9 @@ class NgwWebmapLayerAdapter {
|
|
|
4891
5082
|
item = __spreadValues$h(__spreadValues$h({}, layerItem), layerAdapterOptions);
|
|
4892
5083
|
}
|
|
4893
5084
|
}
|
|
5085
|
+
if (typeof ((_a = this.options.nativeOptions) == null ? void 0 : _a.beforeItemCreated) === "function") {
|
|
5086
|
+
item = this.options.nativeOptions.beforeItemCreated(item);
|
|
5087
|
+
}
|
|
4894
5088
|
return item;
|
|
4895
5089
|
}
|
|
4896
5090
|
}
|
|
@@ -5776,42 +5970,6 @@ var __async$c = (__this, __arguments, generator) => {
|
|
|
5776
5970
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5777
5971
|
});
|
|
5778
5972
|
};
|
|
5779
|
-
class Legend {
|
|
5780
|
-
constructor({
|
|
5781
|
-
layerId,
|
|
5782
|
-
legend,
|
|
5783
|
-
onSymbolRenderChange
|
|
5784
|
-
}) {
|
|
5785
|
-
__publicField$c(this, "layerId");
|
|
5786
|
-
__publicField$c(this, "legend");
|
|
5787
|
-
__publicField$c(this, "onSymbolRenderChange");
|
|
5788
|
-
this.layerId = layerId;
|
|
5789
|
-
this.legend = this.createLegend(legend);
|
|
5790
|
-
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
5791
|
-
}
|
|
5792
|
-
createLegend(items) {
|
|
5793
|
-
return items.map((params) => __spreadProps$6(__spreadValues$b({}, params), {
|
|
5794
|
-
/** @deprecated use display_name instead */
|
|
5795
|
-
name: params.display_name,
|
|
5796
|
-
/** @deprecated use icon instead */
|
|
5797
|
-
symbol: params.icon
|
|
5798
|
-
}));
|
|
5799
|
-
}
|
|
5800
|
-
setSymbolRender(symbolIndex, status) {
|
|
5801
|
-
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
5802
|
-
if (legendItem) {
|
|
5803
|
-
const render = legendItem.render;
|
|
5804
|
-
if (render !== status) {
|
|
5805
|
-
legendItem.render = status;
|
|
5806
|
-
if (this.onSymbolRenderChange) {
|
|
5807
|
-
this.onSymbolRenderChange(
|
|
5808
|
-
this.legend.filter((l) => l.render).map((l) => l.index)
|
|
5809
|
-
);
|
|
5810
|
-
}
|
|
5811
|
-
}
|
|
5812
|
-
}
|
|
5813
|
-
}
|
|
5814
|
-
}
|
|
5815
5973
|
function createRasterAdapter(_0) {
|
|
5816
5974
|
return __async$c(this, arguments, function* ({
|
|
5817
5975
|
layerOptions,
|
|
@@ -5847,8 +6005,8 @@ function createRasterAdapter(_0) {
|
|
|
5847
6005
|
this.map = map;
|
|
5848
6006
|
__publicField$c(this, "item", item);
|
|
5849
6007
|
__publicField$c(this, "resourceId", resourceId);
|
|
5850
|
-
__publicField$c(this, "
|
|
5851
|
-
__publicField$c(this, "
|
|
6008
|
+
__publicField$c(this, "blocked", false);
|
|
6009
|
+
__publicField$c(this, "layerVisibility");
|
|
5852
6010
|
const opt = ngwApiToAdapterOptions({
|
|
5853
6011
|
options: layerOptions,
|
|
5854
6012
|
webMap,
|
|
@@ -5869,24 +6027,6 @@ function createRasterAdapter(_0) {
|
|
|
5869
6027
|
addLayer(addOptions) {
|
|
5870
6028
|
return super.addLayer(__spreadValues$b(__spreadValues$b({}, this.options), addOptions));
|
|
5871
6029
|
}
|
|
5872
|
-
showLayer() {
|
|
5873
|
-
this._layerVisibility = true;
|
|
5874
|
-
if (!this._blocked) {
|
|
5875
|
-
if (super.showLayer) {
|
|
5876
|
-
super.showLayer(this.layer);
|
|
5877
|
-
} else if (this.layer) {
|
|
5878
|
-
webMap.mapAdapter.showLayer(this.layer);
|
|
5879
|
-
}
|
|
5880
|
-
}
|
|
5881
|
-
}
|
|
5882
|
-
hideLayer() {
|
|
5883
|
-
this._layerVisibility = false;
|
|
5884
|
-
if (super.hideLayer) {
|
|
5885
|
-
super.hideLayer(this.layer);
|
|
5886
|
-
} else if (this.layer) {
|
|
5887
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5888
|
-
}
|
|
5889
|
-
}
|
|
5890
6030
|
getIdentificationIds() {
|
|
5891
6031
|
return __async$c(this, null, function* () {
|
|
5892
6032
|
if (this.item) {
|
|
@@ -5912,59 +6052,16 @@ function createRasterAdapter(_0) {
|
|
|
5912
6052
|
}, options));
|
|
5913
6053
|
const legend = new Legend({
|
|
5914
6054
|
layerId: id,
|
|
5915
|
-
|
|
5916
|
-
|
|
6055
|
+
layer: this,
|
|
6056
|
+
resourceId,
|
|
6057
|
+
webMap,
|
|
6058
|
+
legend: ngwLegend
|
|
5917
6059
|
});
|
|
5918
6060
|
return [legend];
|
|
5919
6061
|
}
|
|
5920
6062
|
return [];
|
|
5921
6063
|
});
|
|
5922
6064
|
}
|
|
5923
|
-
_hideLayer() {
|
|
5924
|
-
if (this.options.id) {
|
|
5925
|
-
webMap.mapAdapter.hideLayer(this.layer);
|
|
5926
|
-
}
|
|
5927
|
-
}
|
|
5928
|
-
_showLayer() {
|
|
5929
|
-
if (this.options.id) {
|
|
5930
|
-
if (this._layerVisibility) {
|
|
5931
|
-
webMap.showLayer(this.options.id, { silent: true });
|
|
5932
|
-
}
|
|
5933
|
-
}
|
|
5934
|
-
}
|
|
5935
|
-
_setLegendSymbol(renderIndexes) {
|
|
5936
|
-
const intervals = this._consolidateIntervals(renderIndexes);
|
|
5937
|
-
if (!intervals.length) {
|
|
5938
|
-
this._hideLayer();
|
|
5939
|
-
this._blocked = true;
|
|
5940
|
-
} else {
|
|
5941
|
-
this._blocked = false;
|
|
5942
|
-
this._showLayer();
|
|
5943
|
-
}
|
|
5944
|
-
if (this.updateLayer) {
|
|
5945
|
-
this.updateLayer({
|
|
5946
|
-
params: {
|
|
5947
|
-
[`symbols[${resourceId}]`]: intervals.join(",") || void 0
|
|
5948
|
-
}
|
|
5949
|
-
});
|
|
5950
|
-
}
|
|
5951
|
-
}
|
|
5952
|
-
_consolidateIntervals(symbols) {
|
|
5953
|
-
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
5954
|
-
const intervals = [];
|
|
5955
|
-
let start = sortedSymbols[0];
|
|
5956
|
-
let end = start;
|
|
5957
|
-
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
5958
|
-
if (sortedSymbols[i] === end + 1) {
|
|
5959
|
-
end = sortedSymbols[i];
|
|
5960
|
-
} else {
|
|
5961
|
-
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
5962
|
-
start = sortedSymbols[i];
|
|
5963
|
-
end = start;
|
|
5964
|
-
}
|
|
5965
|
-
}
|
|
5966
|
-
return intervals;
|
|
5967
|
-
}
|
|
5968
6065
|
};
|
|
5969
6066
|
} else {
|
|
5970
6067
|
throw new Error(adapter + " not supported yet. Only TILE");
|
|
@@ -6326,16 +6423,25 @@ class IdentifyItem {
|
|
|
6326
6423
|
});
|
|
6327
6424
|
}
|
|
6328
6425
|
resource(opt) {
|
|
6426
|
+
return __async$9(this, null, function* () {
|
|
6427
|
+
const composite = yield this.composite(opt);
|
|
6428
|
+
return composite.feature_layer;
|
|
6429
|
+
});
|
|
6430
|
+
}
|
|
6431
|
+
composite(opt) {
|
|
6329
6432
|
return __async$9(this, null, function* () {
|
|
6330
6433
|
if (this._resource && this._resource.feature_layer) {
|
|
6331
|
-
return this._resource
|
|
6434
|
+
return this._resource;
|
|
6332
6435
|
}
|
|
6333
6436
|
const resp = yield this.connector.getResource(this.layerId, opt);
|
|
6334
|
-
if (!
|
|
6335
|
-
throw new Error("Resource
|
|
6437
|
+
if (!resp) {
|
|
6438
|
+
throw new Error("Resource does not exist");
|
|
6439
|
+
}
|
|
6440
|
+
if (!resp.feature_layer) {
|
|
6441
|
+
throw new Error("Resource is not a vector layer");
|
|
6336
6442
|
}
|
|
6337
6443
|
this._resource = resp;
|
|
6338
|
-
return resp
|
|
6444
|
+
return resp;
|
|
6339
6445
|
});
|
|
6340
6446
|
}
|
|
6341
6447
|
getBounds(opt) {
|
|
@@ -6348,7 +6454,7 @@ class IdentifyItem {
|
|
|
6348
6454
|
resourceId: this.layerId
|
|
6349
6455
|
}, opt));
|
|
6350
6456
|
}
|
|
6351
|
-
geojson(options) {
|
|
6457
|
+
geojson(options = {}) {
|
|
6352
6458
|
if (this._geojson) {
|
|
6353
6459
|
return Promise.resolve(this._geojson);
|
|
6354
6460
|
}
|
|
@@ -10201,7 +10307,8 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
10201
10307
|
const identFunc = typeof layer.getIdentificationIds === "function" ? layer.getIdentificationIds : false;
|
|
10202
10308
|
const interactive = (_a = layer.options.interactive) != null ? _a : true;
|
|
10203
10309
|
if (identFunc && layer.options.selectable && interactive && this.isLayerVisible(layer)) {
|
|
10204
|
-
|
|
10310
|
+
const layerIds = identFunc.call(layer);
|
|
10311
|
+
promises.push(layerIds);
|
|
10205
10312
|
}
|
|
10206
10313
|
}
|
|
10207
10314
|
const getIdsPromise = Promise.all(promises);
|