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