@nextgis/ngw-map 4.0.0-alpha.5 → 4.0.0-alpha.8
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/index.d.ts +1 -1
- package/lib/ngw-map.cjs.js +1 -1
- package/lib/ngw-map.css +1 -1
- package/lib/ngw-map.esm-browser.js +224 -312
- 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 +1 -1
- package/lib/ngw-map.global.js +224 -312
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 4.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 4.0.0-alpha.8; author: NextGIS */
|
|
2
2
|
const svgPath = {
|
|
3
3
|
brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
|
|
4
4
|
circle: '<circle cx="6" cy="6" r="6"/>',
|
|
@@ -344,9 +344,6 @@ function objectRemoveEmpty(obj) {
|
|
|
344
344
|
function isObject$1(val) {
|
|
345
345
|
return Object.prototype.toString.call(val) === "[object Object]";
|
|
346
346
|
}
|
|
347
|
-
function isArray(val) {
|
|
348
|
-
return Object.prototype.toString.call(val) === "[object Array]";
|
|
349
|
-
}
|
|
350
347
|
|
|
351
348
|
function fixUrlStr(url) {
|
|
352
349
|
return url.replace(/([^:]\/)\/+/g, "$1");
|
|
@@ -395,7 +392,7 @@ var __spreadValues$z = (a, b) => {
|
|
|
395
392
|
}
|
|
396
393
|
return a;
|
|
397
394
|
};
|
|
398
|
-
var __async$
|
|
395
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
399
396
|
return new Promise((resolve, reject) => {
|
|
400
397
|
var fulfilled = (value) => {
|
|
401
398
|
try {
|
|
@@ -416,7 +413,7 @@ var __async$x = (__this, __arguments, generator) => {
|
|
|
416
413
|
});
|
|
417
414
|
};
|
|
418
415
|
function apiRequest(opt) {
|
|
419
|
-
return __async$
|
|
416
|
+
return __async$w(this, null, function* () {
|
|
420
417
|
const { params, name, connector, requestOptions } = opt;
|
|
421
418
|
const apiItems = yield connector.connect();
|
|
422
419
|
let apiItem = apiItems && apiItems[name];
|
|
@@ -1080,7 +1077,7 @@ function unwrapListeners(arr) {
|
|
|
1080
1077
|
}
|
|
1081
1078
|
|
|
1082
1079
|
var pkg = {
|
|
1083
|
-
version: "4.0.0-alpha.
|
|
1080
|
+
version: "4.0.0-alpha.8"};
|
|
1084
1081
|
|
|
1085
1082
|
class AbortError extends Error {
|
|
1086
1083
|
constructor(message = "AbortError") {
|
|
@@ -1294,7 +1291,7 @@ var __objRest$7 = (source, exclude) => {
|
|
|
1294
1291
|
}
|
|
1295
1292
|
return target;
|
|
1296
1293
|
};
|
|
1297
|
-
var __async$
|
|
1294
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
1298
1295
|
return new Promise((resolve, reject) => {
|
|
1299
1296
|
var fulfilled = (value) => {
|
|
1300
1297
|
try {
|
|
@@ -1319,7 +1316,7 @@ function lunkwillCheckResponse(lwResp) {
|
|
|
1319
1316
|
return ct !== void 0 && ct !== null && ct.includes("application/vnd.lunkwill.request-summary+json");
|
|
1320
1317
|
}
|
|
1321
1318
|
function responseJson(response) {
|
|
1322
|
-
return __async$
|
|
1319
|
+
return __async$v(this, null, function* () {
|
|
1323
1320
|
try {
|
|
1324
1321
|
return response.json();
|
|
1325
1322
|
} catch (e) {
|
|
@@ -1328,7 +1325,7 @@ function responseJson(response) {
|
|
|
1328
1325
|
});
|
|
1329
1326
|
}
|
|
1330
1327
|
function lunkwillResponseUrl(lwResp) {
|
|
1331
|
-
return __async$
|
|
1328
|
+
return __async$v(this, null, function* () {
|
|
1332
1329
|
const lwData = yield responseJson(lwResp);
|
|
1333
1330
|
let delay = lwData.delay_ms;
|
|
1334
1331
|
const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
|
|
@@ -1372,7 +1369,7 @@ function lunkwillResponseUrl(lwResp) {
|
|
|
1372
1369
|
});
|
|
1373
1370
|
}
|
|
1374
1371
|
function lunkwillFetch(lwRespUrl) {
|
|
1375
|
-
return __async$
|
|
1372
|
+
return __async$v(this, null, function* () {
|
|
1376
1373
|
try {
|
|
1377
1374
|
return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
|
|
1378
1375
|
} catch (e) {
|
|
@@ -1420,7 +1417,7 @@ function generateUrl(path, query) {
|
|
|
1420
1417
|
return path + urlParams;
|
|
1421
1418
|
}
|
|
1422
1419
|
function request(path, options, cacheEngine) {
|
|
1423
|
-
return __async$
|
|
1420
|
+
return __async$v(this, null, function* () {
|
|
1424
1421
|
var _b, _c;
|
|
1425
1422
|
const defaults = {
|
|
1426
1423
|
method: "GET",
|
|
@@ -1464,7 +1461,7 @@ function request(path, options, cacheEngine) {
|
|
|
1464
1461
|
opt.headers = headers;
|
|
1465
1462
|
}
|
|
1466
1463
|
const url = generateUrl(path, query);
|
|
1467
|
-
const makeRequest = () => __async$
|
|
1464
|
+
const makeRequest = () => __async$v(null, null, function* () {
|
|
1468
1465
|
let response;
|
|
1469
1466
|
try {
|
|
1470
1467
|
response = yield fetch(url, opt);
|
|
@@ -1528,8 +1525,8 @@ function request(path, options, cacheEngine) {
|
|
|
1528
1525
|
}
|
|
1529
1526
|
|
|
1530
1527
|
var __defProp$L = Object.defineProperty;
|
|
1531
|
-
var __defProps$
|
|
1532
|
-
var __getOwnPropDescs$
|
|
1528
|
+
var __defProps$l = Object.defineProperties;
|
|
1529
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
1533
1530
|
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
1534
1531
|
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
1535
1532
|
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
@@ -1545,7 +1542,7 @@ var __spreadValues$x = (a, b) => {
|
|
|
1545
1542
|
}
|
|
1546
1543
|
return a;
|
|
1547
1544
|
};
|
|
1548
|
-
var __spreadProps$
|
|
1545
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
1549
1546
|
var __objRest$6 = (source, exclude) => {
|
|
1550
1547
|
var target = {};
|
|
1551
1548
|
for (var prop in source)
|
|
@@ -1558,7 +1555,7 @@ var __objRest$6 = (source, exclude) => {
|
|
|
1558
1555
|
}
|
|
1559
1556
|
return target;
|
|
1560
1557
|
};
|
|
1561
|
-
var __async$
|
|
1558
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
1562
1559
|
return new Promise((resolve, reject) => {
|
|
1563
1560
|
var fulfilled = (value) => {
|
|
1564
1561
|
try {
|
|
@@ -1609,7 +1606,7 @@ function routeURL(name, baseUrl, routeData, ...rest) {
|
|
|
1609
1606
|
}
|
|
1610
1607
|
function route(name, connector, ...rest) {
|
|
1611
1608
|
const result = {
|
|
1612
|
-
url: (opt) => __async$
|
|
1609
|
+
url: (opt) => __async$u(null, null, function* () {
|
|
1613
1610
|
var _a;
|
|
1614
1611
|
const routeData = yield connector.connect();
|
|
1615
1612
|
const template = routeURL(
|
|
@@ -1640,7 +1637,7 @@ function route(name, connector, ...rest) {
|
|
|
1640
1637
|
const headers = objectRemoveEmpty(__spreadValues$x(__spreadValues$x({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
|
|
1641
1638
|
return request(
|
|
1642
1639
|
template,
|
|
1643
|
-
__spreadProps$
|
|
1640
|
+
__spreadProps$l(__spreadValues$x({
|
|
1644
1641
|
headers
|
|
1645
1642
|
}, restOpt), {
|
|
1646
1643
|
method
|
|
@@ -1765,8 +1762,8 @@ function removeConnector(connector) {
|
|
|
1765
1762
|
}
|
|
1766
1763
|
|
|
1767
1764
|
var __defProp$K = Object.defineProperty;
|
|
1768
|
-
var __defProps$
|
|
1769
|
-
var __getOwnPropDescs$
|
|
1765
|
+
var __defProps$k = Object.defineProperties;
|
|
1766
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
|
1770
1767
|
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
1771
1768
|
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
1772
1769
|
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
@@ -1782,7 +1779,7 @@ var __spreadValues$w = (a, b) => {
|
|
|
1782
1779
|
}
|
|
1783
1780
|
return a;
|
|
1784
1781
|
};
|
|
1785
|
-
var __spreadProps$
|
|
1782
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
1786
1783
|
var __objRest$5 = (source, exclude) => {
|
|
1787
1784
|
var target = {};
|
|
1788
1785
|
for (var prop in source)
|
|
@@ -1796,7 +1793,7 @@ var __objRest$5 = (source, exclude) => {
|
|
|
1796
1793
|
return target;
|
|
1797
1794
|
};
|
|
1798
1795
|
var __publicField$u = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1799
|
-
var __async$
|
|
1796
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
1800
1797
|
return new Promise((resolve, reject) => {
|
|
1801
1798
|
var fulfilled = (value) => {
|
|
1802
1799
|
try {
|
|
@@ -1820,7 +1817,7 @@ let ID$2 = 0;
|
|
|
1820
1817
|
let REQUEST_ID = 0;
|
|
1821
1818
|
class NgwConnector {
|
|
1822
1819
|
constructor(options) {
|
|
1823
|
-
this
|
|
1820
|
+
__publicField$u(this, "options", options);
|
|
1824
1821
|
__publicField$u(this, "id", ID$2++);
|
|
1825
1822
|
__publicField$u(this, "emitter", new EventEmitter());
|
|
1826
1823
|
__publicField$u(this, "user");
|
|
@@ -1885,7 +1882,7 @@ class NgwConnector {
|
|
|
1885
1882
|
* ```
|
|
1886
1883
|
*/
|
|
1887
1884
|
connect() {
|
|
1888
|
-
return __async$
|
|
1885
|
+
return __async$t(this, arguments, function* ({
|
|
1889
1886
|
signal
|
|
1890
1887
|
} = {}) {
|
|
1891
1888
|
const auth = this.options.auth;
|
|
@@ -1924,7 +1921,7 @@ class NgwConnector {
|
|
|
1924
1921
|
this.emitter.emit("logout");
|
|
1925
1922
|
}
|
|
1926
1923
|
getUserInfo(credentials, options) {
|
|
1927
|
-
return __async$
|
|
1924
|
+
return __async$t(this, null, function* () {
|
|
1928
1925
|
if (this.user && this.user.id) {
|
|
1929
1926
|
return this.user;
|
|
1930
1927
|
}
|
|
@@ -1984,7 +1981,7 @@ class NgwConnector {
|
|
|
1984
1981
|
* @param options - Request options
|
|
1985
1982
|
*/
|
|
1986
1983
|
makeQuery(_0, _1) {
|
|
1987
|
-
return __async$
|
|
1984
|
+
return __async$t(this, arguments, function* (url, params, options = {}) {
|
|
1988
1985
|
var _b;
|
|
1989
1986
|
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
1990
1987
|
if (!url) {
|
|
@@ -2017,7 +2014,7 @@ class NgwConnector {
|
|
|
2017
2014
|
});
|
|
2018
2015
|
}
|
|
2019
2016
|
options.signal = internalSignal;
|
|
2020
|
-
const createPromise = () => __async$
|
|
2017
|
+
const createPromise = () => __async$t(this, null, function* () {
|
|
2021
2018
|
const id = REQUEST_ID++;
|
|
2022
2019
|
this.activeRequests[id] = internalAbortController;
|
|
2023
2020
|
try {
|
|
@@ -2027,7 +2024,7 @@ class NgwConnector {
|
|
|
2027
2024
|
}
|
|
2028
2025
|
});
|
|
2029
2026
|
if (method === "GET" && cache !== false) {
|
|
2030
|
-
const cacheOptions = cacheProps ? cacheProps : __spreadProps$
|
|
2027
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$k(__spreadValues$w({}, objectRemoveEmpty({
|
|
2031
2028
|
headers,
|
|
2032
2029
|
withCredentials,
|
|
2033
2030
|
responseType,
|
|
@@ -2081,7 +2078,7 @@ class NgwConnector {
|
|
|
2081
2078
|
});
|
|
2082
2079
|
}
|
|
2083
2080
|
_login(credentials, options) {
|
|
2084
|
-
return __async$
|
|
2081
|
+
return __async$t(this, null, function* () {
|
|
2085
2082
|
try {
|
|
2086
2083
|
const data = yield this.getUserInfo(credentials, options);
|
|
2087
2084
|
this.user = data;
|
|
@@ -2140,8 +2137,8 @@ function resourceToQuery(resource, prefix = "") {
|
|
|
2140
2137
|
}
|
|
2141
2138
|
|
|
2142
2139
|
var __defProp$J = Object.defineProperty;
|
|
2143
|
-
var __defProps$
|
|
2144
|
-
var __getOwnPropDescs$
|
|
2140
|
+
var __defProps$j = Object.defineProperties;
|
|
2141
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
2145
2142
|
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
2146
2143
|
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
2147
2144
|
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
@@ -2157,9 +2154,9 @@ var __spreadValues$v = (a, b) => {
|
|
|
2157
2154
|
}
|
|
2158
2155
|
return a;
|
|
2159
2156
|
};
|
|
2160
|
-
var __spreadProps$
|
|
2157
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
2161
2158
|
var __publicField$t = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2162
|
-
var __async$
|
|
2159
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
2163
2160
|
return new Promise((resolve, reject) => {
|
|
2164
2161
|
var fulfilled = (value) => {
|
|
2165
2162
|
try {
|
|
@@ -2277,19 +2274,20 @@ class ResourcesControl {
|
|
|
2277
2274
|
} else {
|
|
2278
2275
|
Object.assign(query, resourceToQuery(resource));
|
|
2279
2276
|
}
|
|
2280
|
-
return this.connector.route("resource.search").get(__spreadProps$
|
|
2277
|
+
return this.connector.route("resource.search").get(__spreadProps$j(__spreadValues$v({}, requestOptions), {
|
|
2281
2278
|
query: __spreadValues$v({
|
|
2282
2279
|
serialization: "full"
|
|
2283
2280
|
}, query)
|
|
2284
2281
|
})).then((resources) => {
|
|
2285
|
-
|
|
2286
|
-
|
|
2282
|
+
const items2 = Array.isArray(resources) ? resources : resources.items;
|
|
2283
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
2284
|
+
for (const x of items2) {
|
|
2287
2285
|
this.cache.add("resource.item", Promise.resolve(x), {
|
|
2288
2286
|
id: x.resource.id
|
|
2289
2287
|
});
|
|
2290
2288
|
}
|
|
2291
2289
|
}
|
|
2292
|
-
return
|
|
2290
|
+
return items2;
|
|
2293
2291
|
});
|
|
2294
2292
|
}
|
|
2295
2293
|
return items;
|
|
@@ -2331,7 +2329,7 @@ class ResourcesControl {
|
|
|
2331
2329
|
});
|
|
2332
2330
|
}
|
|
2333
2331
|
_getChildrenOf(_0, _1) {
|
|
2334
|
-
return __async$
|
|
2332
|
+
return __async$s(this, arguments, function* (parentDef, requestOptions, _items = []) {
|
|
2335
2333
|
let parent = void 0;
|
|
2336
2334
|
if (typeof parentDef === "string") {
|
|
2337
2335
|
parent = yield this.getId(parentDef, requestOptions);
|
|
@@ -2340,7 +2338,7 @@ class ResourcesControl {
|
|
|
2340
2338
|
} else {
|
|
2341
2339
|
parent = parentDef;
|
|
2342
2340
|
}
|
|
2343
|
-
const items = yield this.connector.route("resource.collection").get(__spreadProps$
|
|
2341
|
+
const items = yield this.connector.route("resource.collection").get(__spreadProps$j(__spreadValues$v({}, requestOptions), {
|
|
2344
2342
|
query: {
|
|
2345
2343
|
parent
|
|
2346
2344
|
}
|
|
@@ -2368,7 +2366,7 @@ class ResourcesControl {
|
|
|
2368
2366
|
});
|
|
2369
2367
|
}
|
|
2370
2368
|
_cleanResourceItemCache(id) {
|
|
2371
|
-
return __async$
|
|
2369
|
+
return __async$s(this, null, function* () {
|
|
2372
2370
|
var _a;
|
|
2373
2371
|
const all = this.cache.all();
|
|
2374
2372
|
const toDelete = [];
|
|
@@ -2638,8 +2636,8 @@ class NgwConnectorExtended extends NgwConnector {
|
|
|
2638
2636
|
}
|
|
2639
2637
|
|
|
2640
2638
|
var __defProp$H = Object.defineProperty;
|
|
2641
|
-
var __defProps$
|
|
2642
|
-
var __getOwnPropDescs$
|
|
2639
|
+
var __defProps$i = Object.defineProperties;
|
|
2640
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
2643
2641
|
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
2644
2642
|
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
2645
2643
|
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
@@ -2655,7 +2653,7 @@ var __spreadValues$u = (a, b) => {
|
|
|
2655
2653
|
}
|
|
2656
2654
|
return a;
|
|
2657
2655
|
};
|
|
2658
|
-
var __spreadProps$
|
|
2656
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
2659
2657
|
function getNgwWebmapExtent(webmap) {
|
|
2660
2658
|
const bottom = webmap["extent_bottom"];
|
|
2661
2659
|
const left = webmap["extent_left"];
|
|
@@ -2722,14 +2720,14 @@ function fetchNgwResourceExtent(item, connector, options) {
|
|
|
2722
2720
|
if (resource.cls && resource.parent && resource.cls.indexOf("style") !== -1) {
|
|
2723
2721
|
return connector.getResource(resource.parent.id, options).then((res) => {
|
|
2724
2722
|
if (res) {
|
|
2725
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2723
|
+
return fetchNgwLayerExtent(__spreadProps$i(__spreadValues$u({}, options), {
|
|
2726
2724
|
resourceId: res.resource.id,
|
|
2727
2725
|
connector
|
|
2728
2726
|
}));
|
|
2729
2727
|
}
|
|
2730
2728
|
});
|
|
2731
2729
|
} else {
|
|
2732
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
2730
|
+
return fetchNgwLayerExtent(__spreadProps$i(__spreadValues$u({}, options), {
|
|
2733
2731
|
resourceId: resource.id,
|
|
2734
2732
|
connector
|
|
2735
2733
|
}));
|
|
@@ -2740,7 +2738,7 @@ function fetchNgwResourceExtent(item, connector, options) {
|
|
|
2740
2738
|
var __defProp$G = Object.defineProperty;
|
|
2741
2739
|
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2742
2740
|
var __publicField$r = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2743
|
-
var __async$
|
|
2741
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
2744
2742
|
return new Promise((resolve, reject) => {
|
|
2745
2743
|
var fulfilled = (value) => {
|
|
2746
2744
|
try {
|
|
@@ -2768,12 +2766,12 @@ class NgwResource {
|
|
|
2768
2766
|
}
|
|
2769
2767
|
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
2770
2768
|
getExtent() {
|
|
2771
|
-
return __async$
|
|
2769
|
+
return __async$r(this, null, function* () {
|
|
2772
2770
|
return this.getBounds();
|
|
2773
2771
|
});
|
|
2774
2772
|
}
|
|
2775
2773
|
getBounds(options) {
|
|
2776
|
-
return __async$
|
|
2774
|
+
return __async$r(this, null, function* () {
|
|
2777
2775
|
if (this._extent) {
|
|
2778
2776
|
return this._extent;
|
|
2779
2777
|
}
|
|
@@ -2789,7 +2787,7 @@ class NgwResource {
|
|
|
2789
2787
|
}
|
|
2790
2788
|
}
|
|
2791
2789
|
|
|
2792
|
-
var __async$
|
|
2790
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
2793
2791
|
return new Promise((resolve, reject) => {
|
|
2794
2792
|
var fulfilled = (value) => {
|
|
2795
2793
|
try {
|
|
@@ -2810,7 +2808,7 @@ var __async$r = (__this, __arguments, generator) => {
|
|
|
2810
2808
|
});
|
|
2811
2809
|
};
|
|
2812
2810
|
function resourceIdFromLayerOptions(options, connector) {
|
|
2813
|
-
return __async$
|
|
2811
|
+
return __async$q(this, null, function* () {
|
|
2814
2812
|
const resource = options.resource;
|
|
2815
2813
|
const item = resource;
|
|
2816
2814
|
let { keyname, resourceId } = options;
|
|
@@ -2852,7 +2850,7 @@ var __spreadValues$t = (a, b) => {
|
|
|
2852
2850
|
return a;
|
|
2853
2851
|
};
|
|
2854
2852
|
var __publicField$q = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2855
|
-
var __async$
|
|
2853
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
2856
2854
|
return new Promise((resolve, reject) => {
|
|
2857
2855
|
var fulfilled = (value) => {
|
|
2858
2856
|
try {
|
|
@@ -2873,7 +2871,7 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
2873
2871
|
});
|
|
2874
2872
|
};
|
|
2875
2873
|
function createOnFirstShowAdapter(_0) {
|
|
2876
|
-
return __async$
|
|
2874
|
+
return __async$p(this, arguments, function* ({
|
|
2877
2875
|
webMap,
|
|
2878
2876
|
adapterOptions = {},
|
|
2879
2877
|
onLayerAdded,
|
|
@@ -2899,7 +2897,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2899
2897
|
return this._removed;
|
|
2900
2898
|
}
|
|
2901
2899
|
showLayer() {
|
|
2902
|
-
return __async$
|
|
2900
|
+
return __async$p(this, null, function* () {
|
|
2903
2901
|
this.options.visibility = true;
|
|
2904
2902
|
if (this.layer.length) {
|
|
2905
2903
|
for (const x of this.layer) {
|
|
@@ -2911,7 +2909,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2911
2909
|
});
|
|
2912
2910
|
}
|
|
2913
2911
|
hideLayer() {
|
|
2914
|
-
return __async$
|
|
2912
|
+
return __async$p(this, null, function* () {
|
|
2915
2913
|
this.options.visibility = false;
|
|
2916
2914
|
if (this.layer) {
|
|
2917
2915
|
for (const x of this.layer) {
|
|
@@ -2921,7 +2919,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2921
2919
|
});
|
|
2922
2920
|
}
|
|
2923
2921
|
loadLayer() {
|
|
2924
|
-
return __async$
|
|
2922
|
+
return __async$p(this, null, function* () {
|
|
2925
2923
|
if (!this.layer.length && !this._creatingInProgress) {
|
|
2926
2924
|
this._creatingInProgress = true;
|
|
2927
2925
|
const Adapter = yield createAdapter(this);
|
|
@@ -2955,7 +2953,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
2955
2953
|
});
|
|
2956
2954
|
}
|
|
2957
2955
|
|
|
2958
|
-
var __async$
|
|
2956
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
2959
2957
|
return new Promise((resolve, reject) => {
|
|
2960
2958
|
var fulfilled = (value) => {
|
|
2961
2959
|
try {
|
|
@@ -2976,7 +2974,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
2976
2974
|
});
|
|
2977
2975
|
};
|
|
2978
2976
|
function createOnFirstShowNgwAdapter(_0) {
|
|
2979
|
-
return __async$
|
|
2977
|
+
return __async$o(this, arguments, function* ({
|
|
2980
2978
|
webMap,
|
|
2981
2979
|
connector,
|
|
2982
2980
|
item,
|
|
@@ -3105,8 +3103,6 @@ function propertiesFilter(properties, filters) {
|
|
|
3105
3103
|
}
|
|
3106
3104
|
|
|
3107
3105
|
var __defProp$D = Object.defineProperty;
|
|
3108
|
-
var __defProps$i = Object.defineProperties;
|
|
3109
|
-
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
3110
3106
|
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
3111
3107
|
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
3112
3108
|
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
@@ -3122,27 +3118,6 @@ var __spreadValues$r = (a, b) => {
|
|
|
3122
3118
|
}
|
|
3123
3119
|
return a;
|
|
3124
3120
|
};
|
|
3125
|
-
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
3126
|
-
var __async$o = (__this, __arguments, generator) => {
|
|
3127
|
-
return new Promise((resolve, reject) => {
|
|
3128
|
-
var fulfilled = (value) => {
|
|
3129
|
-
try {
|
|
3130
|
-
step(generator.next(value));
|
|
3131
|
-
} catch (e) {
|
|
3132
|
-
reject(e);
|
|
3133
|
-
}
|
|
3134
|
-
};
|
|
3135
|
-
var rejected = (value) => {
|
|
3136
|
-
try {
|
|
3137
|
-
step(generator.throw(value));
|
|
3138
|
-
} catch (e) {
|
|
3139
|
-
reject(e);
|
|
3140
|
-
}
|
|
3141
|
-
};
|
|
3142
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
3143
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
3144
|
-
});
|
|
3145
|
-
};
|
|
3146
3121
|
const FEATURE_REQUEST_PARAMS = {
|
|
3147
3122
|
srs: 4326,
|
|
3148
3123
|
geom_format: "geojson",
|
|
@@ -3189,86 +3164,6 @@ function paramListToQuery(paramList) {
|
|
|
3189
3164
|
{}
|
|
3190
3165
|
);
|
|
3191
3166
|
}
|
|
3192
|
-
function createFeatureFieldFilterQueries(opt) {
|
|
3193
|
-
return __async$o(this, null, function* () {
|
|
3194
|
-
const queries = getQueries(opt);
|
|
3195
|
-
const itemsParts = yield Promise.all(queries);
|
|
3196
|
-
const ids = [];
|
|
3197
|
-
const items = [];
|
|
3198
|
-
for (const part of itemsParts) {
|
|
3199
|
-
for (const item of part) {
|
|
3200
|
-
if (!ids.includes(item.id)) {
|
|
3201
|
-
items.push(item);
|
|
3202
|
-
ids.push(item.id);
|
|
3203
|
-
}
|
|
3204
|
-
}
|
|
3205
|
-
}
|
|
3206
|
-
const offset = opt.offset !== void 0 ? opt.offset : 0;
|
|
3207
|
-
const limit = opt.limit !== void 0 ? opt.limit : items.length;
|
|
3208
|
-
if (opt.offset || opt.limit) {
|
|
3209
|
-
return items.splice(offset, limit);
|
|
3210
|
-
}
|
|
3211
|
-
return items;
|
|
3212
|
-
});
|
|
3213
|
-
}
|
|
3214
|
-
function createParam(pf) {
|
|
3215
|
-
const [field, operation, value] = pf;
|
|
3216
|
-
const isFldStr = field !== "id" ? "fld_" : "";
|
|
3217
|
-
let vStart = "";
|
|
3218
|
-
let vEnd = "";
|
|
3219
|
-
const field_ = String(field).trim().replace(/^(%?)(.+?)(%?)$/, (m, a, b, c) => {
|
|
3220
|
-
vStart = a;
|
|
3221
|
-
vEnd = c;
|
|
3222
|
-
return b;
|
|
3223
|
-
});
|
|
3224
|
-
const v = vStart + value + vEnd;
|
|
3225
|
-
return [`${isFldStr}${field_}__${operation}`, v];
|
|
3226
|
-
}
|
|
3227
|
-
function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
3228
|
-
var _a;
|
|
3229
|
-
const { filters } = opt;
|
|
3230
|
-
const paramList = (_a = opt.paramList) != null ? _a : [];
|
|
3231
|
-
const logic = typeof filters[0] === "string" ? filters[0] : "all";
|
|
3232
|
-
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
3233
|
-
if (logic === "any") {
|
|
3234
|
-
for (const f of filters_) {
|
|
3235
|
-
if (isPropertyFilter$1(f)) {
|
|
3236
|
-
_queries.push(
|
|
3237
|
-
fetchNgwLayerItemsRequest(__spreadProps$i(__spreadValues$r({}, opt), {
|
|
3238
|
-
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
3239
|
-
}))
|
|
3240
|
-
);
|
|
3241
|
-
} else {
|
|
3242
|
-
getQueries(__spreadProps$i(__spreadValues$r({}, opt), { filters: f }), _queries, [..._parentAllParams]);
|
|
3243
|
-
}
|
|
3244
|
-
}
|
|
3245
|
-
} else if (logic === "all") {
|
|
3246
|
-
const filters2 = [];
|
|
3247
|
-
const propertiesFilterList = [];
|
|
3248
|
-
for (const f of filters_) {
|
|
3249
|
-
if (isPropertyFilter$1(f)) {
|
|
3250
|
-
filters2.push(createParam(f));
|
|
3251
|
-
} else {
|
|
3252
|
-
propertiesFilterList.push(f);
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
if (propertiesFilterList.length) {
|
|
3256
|
-
for (const x of propertiesFilterList) {
|
|
3257
|
-
getQueries(__spreadProps$i(__spreadValues$r({}, opt), { filters: x }), _queries, [
|
|
3258
|
-
..._parentAllParams,
|
|
3259
|
-
...filters2
|
|
3260
|
-
]);
|
|
3261
|
-
}
|
|
3262
|
-
} else {
|
|
3263
|
-
_queries.push(
|
|
3264
|
-
fetchNgwLayerItemsRequest(__spreadProps$i(__spreadValues$r({}, opt), {
|
|
3265
|
-
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
3266
|
-
}))
|
|
3267
|
-
);
|
|
3268
|
-
}
|
|
3269
|
-
}
|
|
3270
|
-
return _queries;
|
|
3271
|
-
}
|
|
3272
3167
|
function createWktFromCoordArray(coord) {
|
|
3273
3168
|
const polygon = coord.map(([lng, lat]) => {
|
|
3274
3169
|
const [x, y] = degrees2meters(lng, lat).map((c) => round(c));
|
|
@@ -3342,6 +3237,147 @@ function prepareNgwFieldsToPropertiesFilter(fields) {
|
|
|
3342
3237
|
return fields;
|
|
3343
3238
|
}
|
|
3344
3239
|
|
|
3240
|
+
function isPropertyFilter(value) {
|
|
3241
|
+
return Array.isArray(value) && value.length === 3 && typeof value[0] === "string" && typeof value[1] === "string";
|
|
3242
|
+
}
|
|
3243
|
+
function isPropertiesFilterGroup(value) {
|
|
3244
|
+
return Array.isArray(value) && !isPropertyFilter(value);
|
|
3245
|
+
}
|
|
3246
|
+
function toGetExpr(field) {
|
|
3247
|
+
return field === "id" ? ["fid"] : ["get", field];
|
|
3248
|
+
}
|
|
3249
|
+
function parseWildcardField(field) {
|
|
3250
|
+
const leadingWildcard = field.startsWith("%");
|
|
3251
|
+
const trailingWildcard = field.endsWith("%");
|
|
3252
|
+
return {
|
|
3253
|
+
field: field.slice(
|
|
3254
|
+
leadingWildcard ? 1 : 0,
|
|
3255
|
+
trailingWildcard ? -1 : void 0
|
|
3256
|
+
),
|
|
3257
|
+
leadingWildcard,
|
|
3258
|
+
trailingWildcard
|
|
3259
|
+
};
|
|
3260
|
+
}
|
|
3261
|
+
function toConditionExpr(filter) {
|
|
3262
|
+
const [fieldRaw, op, value] = filter;
|
|
3263
|
+
const field = String(fieldRaw);
|
|
3264
|
+
const getExpr = toGetExpr(field);
|
|
3265
|
+
switch (op) {
|
|
3266
|
+
case "eq":
|
|
3267
|
+
if (value === null) {
|
|
3268
|
+
return ["is_null", getExpr];
|
|
3269
|
+
}
|
|
3270
|
+
return ["==", getExpr, value];
|
|
3271
|
+
case "ne":
|
|
3272
|
+
if (value === null) {
|
|
3273
|
+
return ["!is_null", getExpr];
|
|
3274
|
+
}
|
|
3275
|
+
return ["!=", getExpr, value];
|
|
3276
|
+
case "gt":
|
|
3277
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
3278
|
+
throw new Error(
|
|
3279
|
+
`Operator "gt" requires number or string for "${field}"`
|
|
3280
|
+
);
|
|
3281
|
+
}
|
|
3282
|
+
return [">", getExpr, value];
|
|
3283
|
+
case "lt":
|
|
3284
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
3285
|
+
throw new Error(
|
|
3286
|
+
`Operator "lt" requires number or string for "${field}"`
|
|
3287
|
+
);
|
|
3288
|
+
}
|
|
3289
|
+
return ["<", getExpr, value];
|
|
3290
|
+
case "ge":
|
|
3291
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
3292
|
+
throw new Error(
|
|
3293
|
+
`Operator "ge" requires number or string for "${field}"`
|
|
3294
|
+
);
|
|
3295
|
+
}
|
|
3296
|
+
return [">=", getExpr, value];
|
|
3297
|
+
case "le":
|
|
3298
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
3299
|
+
throw new Error(
|
|
3300
|
+
`Operator "le" requires number or string for "${field}"`
|
|
3301
|
+
);
|
|
3302
|
+
}
|
|
3303
|
+
return ["<=", getExpr, value];
|
|
3304
|
+
case "in":
|
|
3305
|
+
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
3306
|
+
throw new Error(
|
|
3307
|
+
`Operator "in" requires (string | number)[] for "${field}"`
|
|
3308
|
+
);
|
|
3309
|
+
}
|
|
3310
|
+
if (!value.length) {
|
|
3311
|
+
throw new Error(
|
|
3312
|
+
`Operator "in" requires non-empty array for "${field}"`
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3315
|
+
return ["in", getExpr, ...value];
|
|
3316
|
+
case "notin":
|
|
3317
|
+
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
3318
|
+
throw new Error(
|
|
3319
|
+
`Operator "notin" requires (string | number)[] for "${field}"`
|
|
3320
|
+
);
|
|
3321
|
+
}
|
|
3322
|
+
if (!value.length) {
|
|
3323
|
+
throw new Error(
|
|
3324
|
+
`Operator "notin" requires non-empty array for "${field}"`
|
|
3325
|
+
);
|
|
3326
|
+
}
|
|
3327
|
+
return ["!in", getExpr, ...value];
|
|
3328
|
+
case "ilike": {
|
|
3329
|
+
if (typeof value !== "string") {
|
|
3330
|
+
throw new Error(`Operator "ilike" requires string for "${field}"`);
|
|
3331
|
+
}
|
|
3332
|
+
const parsed = parseWildcardField(field);
|
|
3333
|
+
const pattern = `${parsed.leadingWildcard ? "%" : ""}${value}${parsed.trailingWildcard ? "%" : ""}`;
|
|
3334
|
+
return ["ilike", toGetExpr(parsed.field), pattern];
|
|
3335
|
+
}
|
|
3336
|
+
case "like":
|
|
3337
|
+
throw new Error(
|
|
3338
|
+
`Operator "${op}" is not supported by server FilterExpression`
|
|
3339
|
+
);
|
|
3340
|
+
default: {
|
|
3341
|
+
const exhaustive = op;
|
|
3342
|
+
throw new Error(`Unsupported operator: ${exhaustive}`);
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
function toGroupExpr(filters) {
|
|
3347
|
+
let logicalOp = "all";
|
|
3348
|
+
const children = [];
|
|
3349
|
+
for (const item of filters) {
|
|
3350
|
+
if (item === "all" || item === "any") {
|
|
3351
|
+
logicalOp = item;
|
|
3352
|
+
continue;
|
|
3353
|
+
}
|
|
3354
|
+
if (isPropertyFilter(item)) {
|
|
3355
|
+
children.push(toConditionExpr(item));
|
|
3356
|
+
continue;
|
|
3357
|
+
}
|
|
3358
|
+
if (isPropertiesFilterGroup(item)) {
|
|
3359
|
+
children.push(toGroupExpr(item));
|
|
3360
|
+
continue;
|
|
3361
|
+
}
|
|
3362
|
+
throw new Error("Invalid PropertiesFilter node");
|
|
3363
|
+
}
|
|
3364
|
+
return [logicalOp, ...children];
|
|
3365
|
+
}
|
|
3366
|
+
function propertiesFilterToExpression(filters) {
|
|
3367
|
+
if (!(filters == null ? void 0 : filters.length)) {
|
|
3368
|
+
return [];
|
|
3369
|
+
}
|
|
3370
|
+
return toGroupExpr(filters);
|
|
3371
|
+
}
|
|
3372
|
+
function propertiesFilterToExpressionString(filters) {
|
|
3373
|
+
if (!(filters == null ? void 0 : filters.length)) {
|
|
3374
|
+
return void 0;
|
|
3375
|
+
}
|
|
3376
|
+
return JSON.stringify(
|
|
3377
|
+
propertiesFilterToExpression(filters)
|
|
3378
|
+
);
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3345
3381
|
var __defProp$C = Object.defineProperty;
|
|
3346
3382
|
var __defProps$h = Object.defineProperties;
|
|
3347
3383
|
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
@@ -3386,10 +3422,12 @@ function fetchNgwLayerItems(options) {
|
|
|
3386
3422
|
var _a;
|
|
3387
3423
|
const filters = options.filters;
|
|
3388
3424
|
if (filters) {
|
|
3389
|
-
let data = yield
|
|
3390
|
-
|
|
3425
|
+
let data = yield fetchNgwLayerItemsRequest(__spreadProps$h(__spreadValues$q({}, options), {
|
|
3426
|
+
query: __spreadProps$h(__spreadValues$q({}, options.query), {
|
|
3427
|
+
filter: propertiesFilterToExpressionString(filters)
|
|
3428
|
+
})
|
|
3391
3429
|
}));
|
|
3392
|
-
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a :
|
|
3430
|
+
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : false;
|
|
3393
3431
|
if (clientFilterValidate) {
|
|
3394
3432
|
data = data.filter((y) => {
|
|
3395
3433
|
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$h(__spreadValues$q({}, y.fields), {
|
|
@@ -3405,21 +3443,6 @@ function fetchNgwLayerItems(options) {
|
|
|
3405
3443
|
}
|
|
3406
3444
|
});
|
|
3407
3445
|
}
|
|
3408
|
-
function isFilterWithAnyCase(filters) {
|
|
3409
|
-
if (filters[0] === "any") {
|
|
3410
|
-
return true;
|
|
3411
|
-
}
|
|
3412
|
-
for (let i = 1; i < filters.length; i++) {
|
|
3413
|
-
const p = filters[i];
|
|
3414
|
-
if (isArray(p)) {
|
|
3415
|
-
const deep = isFilterWithAnyCase(p);
|
|
3416
|
-
if (deep) {
|
|
3417
|
-
return true;
|
|
3418
|
-
}
|
|
3419
|
-
}
|
|
3420
|
-
}
|
|
3421
|
-
return false;
|
|
3422
|
-
}
|
|
3423
3446
|
|
|
3424
3447
|
function getImageAdapterOptions({
|
|
3425
3448
|
resourceId,
|
|
@@ -3595,7 +3618,7 @@ var __spreadValues$o = (a, b) => {
|
|
|
3595
3618
|
var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3596
3619
|
class BookmarkItem {
|
|
3597
3620
|
constructor(options) {
|
|
3598
|
-
this
|
|
3621
|
+
__publicField$p(this, "options", options);
|
|
3599
3622
|
__publicField$p(this, "name");
|
|
3600
3623
|
__publicField$p(this, "resourceId");
|
|
3601
3624
|
__publicField$p(this, "item");
|
|
@@ -3917,7 +3940,7 @@ const BOOLEAN_TYPE = "boolean";
|
|
|
3917
3940
|
const STRING_TYPE = "string";
|
|
3918
3941
|
const _ItemProperties = class _ItemProperties {
|
|
3919
3942
|
constructor(item, propertiesList) {
|
|
3920
|
-
this
|
|
3943
|
+
__publicField$m(this, "item", item);
|
|
3921
3944
|
__publicField$m(this, "options", {});
|
|
3922
3945
|
__publicField$m(this, "_properties", {});
|
|
3923
3946
|
__publicField$m(this, "_propertiesList", []);
|
|
@@ -4600,6 +4623,9 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
4600
4623
|
this.tree.addChild(childItem);
|
|
4601
4624
|
}
|
|
4602
4625
|
}
|
|
4626
|
+
if (this.item.item_type === "group" && !group.group_enabled) {
|
|
4627
|
+
this.properties.property("visibility").set(false);
|
|
4628
|
+
}
|
|
4603
4629
|
return Promise.resolve();
|
|
4604
4630
|
}
|
|
4605
4631
|
initLayerItem(layer) {
|
|
@@ -4675,7 +4701,9 @@ __publicField$i(_NgwWebmapItem, "options", {
|
|
|
4675
4701
|
name: "visibility",
|
|
4676
4702
|
getProperty(item) {
|
|
4677
4703
|
if (item) {
|
|
4678
|
-
if (item.item.item_type === "group"
|
|
4704
|
+
if (item.item.item_type === "group") {
|
|
4705
|
+
return item.item.group_enabled;
|
|
4706
|
+
} else if (item.item.item_type === "root") {
|
|
4679
4707
|
return treeSome(
|
|
4680
4708
|
item.item,
|
|
4681
4709
|
(i) => "layer_enabled" in i ? i.layer_enabled : false,
|
|
@@ -4688,7 +4716,9 @@ __publicField$i(_NgwWebmapItem, "options", {
|
|
|
4688
4716
|
return false;
|
|
4689
4717
|
},
|
|
4690
4718
|
onSet(value, options, item) {
|
|
4691
|
-
if (item
|
|
4719
|
+
if ((item == null ? void 0 : item.item.item_type) === "group") {
|
|
4720
|
+
item.item.group_enabled = value;
|
|
4721
|
+
} else if ((item == null ? void 0 : item.item.item_type) === "layer") {
|
|
4692
4722
|
if (item.layer) {
|
|
4693
4723
|
if (value) {
|
|
4694
4724
|
item.webMap.showLayer(item.layer, options);
|
|
@@ -4750,8 +4780,8 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
4750
4780
|
};
|
|
4751
4781
|
class NgwWebmapLayerAdapter {
|
|
4752
4782
|
constructor(map, options) {
|
|
4753
|
-
this
|
|
4754
|
-
this
|
|
4783
|
+
__publicField$h(this, "map", map);
|
|
4784
|
+
__publicField$h(this, "options", options);
|
|
4755
4785
|
__publicField$h(this, "layer");
|
|
4756
4786
|
__publicField$h(this, "NgwWebmapItem", NgwWebmapItem);
|
|
4757
4787
|
/**
|
|
@@ -5989,131 +6019,13 @@ function createWebMapAdapter(_0) {
|
|
|
5989
6019
|
});
|
|
5990
6020
|
}
|
|
5991
6021
|
|
|
5992
|
-
function isPropertyFilter(value) {
|
|
5993
|
-
return Array.isArray(value) && value.length === 3 && typeof value[0] === "string" && typeof value[1] === "string";
|
|
5994
|
-
}
|
|
5995
|
-
function isPropertiesFilterGroup(value) {
|
|
5996
|
-
return Array.isArray(value) && !isPropertyFilter(value);
|
|
5997
|
-
}
|
|
5998
|
-
function toGetExpr(field) {
|
|
5999
|
-
return ["get", field];
|
|
6000
|
-
}
|
|
6001
|
-
function toConditionExpr(filter) {
|
|
6002
|
-
const [fieldRaw, op, value] = filter;
|
|
6003
|
-
const field = String(fieldRaw);
|
|
6004
|
-
const getExpr = toGetExpr(field);
|
|
6005
|
-
switch (op) {
|
|
6006
|
-
case "eq":
|
|
6007
|
-
if (value === null) {
|
|
6008
|
-
return ["is_null", getExpr];
|
|
6009
|
-
}
|
|
6010
|
-
return ["==", getExpr, value];
|
|
6011
|
-
case "ne":
|
|
6012
|
-
if (value === null) {
|
|
6013
|
-
return ["!is_null", getExpr];
|
|
6014
|
-
}
|
|
6015
|
-
return ["!=", getExpr, value];
|
|
6016
|
-
case "gt":
|
|
6017
|
-
if (typeof value !== "number" && typeof value !== "string") {
|
|
6018
|
-
throw new Error(
|
|
6019
|
-
`Operator "gt" requires number or string for "${field}"`
|
|
6020
|
-
);
|
|
6021
|
-
}
|
|
6022
|
-
return [">", getExpr, value];
|
|
6023
|
-
case "lt":
|
|
6024
|
-
if (typeof value !== "number" && typeof value !== "string") {
|
|
6025
|
-
throw new Error(
|
|
6026
|
-
`Operator "lt" requires number or string for "${field}"`
|
|
6027
|
-
);
|
|
6028
|
-
}
|
|
6029
|
-
return ["<", getExpr, value];
|
|
6030
|
-
case "ge":
|
|
6031
|
-
if (typeof value !== "number" && typeof value !== "string") {
|
|
6032
|
-
throw new Error(
|
|
6033
|
-
`Operator "ge" requires number or string for "${field}"`
|
|
6034
|
-
);
|
|
6035
|
-
}
|
|
6036
|
-
return [">=", getExpr, value];
|
|
6037
|
-
case "le":
|
|
6038
|
-
if (typeof value !== "number" && typeof value !== "string") {
|
|
6039
|
-
throw new Error(
|
|
6040
|
-
`Operator "le" requires number or string for "${field}"`
|
|
6041
|
-
);
|
|
6042
|
-
}
|
|
6043
|
-
return ["<=", getExpr, value];
|
|
6044
|
-
case "in":
|
|
6045
|
-
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
6046
|
-
throw new Error(
|
|
6047
|
-
`Operator "in" requires (string | number)[] for "${field}"`
|
|
6048
|
-
);
|
|
6049
|
-
}
|
|
6050
|
-
if (!value.length) {
|
|
6051
|
-
throw new Error(
|
|
6052
|
-
`Operator "in" requires non-empty array for "${field}"`
|
|
6053
|
-
);
|
|
6054
|
-
}
|
|
6055
|
-
return ["in", getExpr, ...value];
|
|
6056
|
-
case "notin":
|
|
6057
|
-
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
6058
|
-
throw new Error(
|
|
6059
|
-
`Operator "notin" requires (string | number)[] for "${field}"`
|
|
6060
|
-
);
|
|
6061
|
-
}
|
|
6062
|
-
if (!value.length) {
|
|
6063
|
-
throw new Error(
|
|
6064
|
-
`Operator "notin" requires non-empty array for "${field}"`
|
|
6065
|
-
);
|
|
6066
|
-
}
|
|
6067
|
-
return ["!in", getExpr, ...value];
|
|
6068
|
-
case "like":
|
|
6069
|
-
case "ilike":
|
|
6070
|
-
throw new Error(
|
|
6071
|
-
`Operator "${op}" is not supported by server FilterExpression`
|
|
6072
|
-
);
|
|
6073
|
-
default: {
|
|
6074
|
-
const exhaustive = op;
|
|
6075
|
-
throw new Error(`Unsupported operator: ${exhaustive}`);
|
|
6076
|
-
}
|
|
6077
|
-
}
|
|
6078
|
-
}
|
|
6079
|
-
function toGroupExpr(filters) {
|
|
6080
|
-
let logicalOp = "all";
|
|
6081
|
-
const children = [];
|
|
6082
|
-
for (const item of filters) {
|
|
6083
|
-
if (item === "all" || item === "any") {
|
|
6084
|
-
logicalOp = item;
|
|
6085
|
-
continue;
|
|
6086
|
-
}
|
|
6087
|
-
if (isPropertyFilter(item)) {
|
|
6088
|
-
children.push(toConditionExpr(item));
|
|
6089
|
-
continue;
|
|
6090
|
-
}
|
|
6091
|
-
if (isPropertiesFilterGroup(item)) {
|
|
6092
|
-
children.push(toGroupExpr(item));
|
|
6093
|
-
continue;
|
|
6094
|
-
}
|
|
6095
|
-
throw new Error("Invalid PropertiesFilter node");
|
|
6096
|
-
}
|
|
6097
|
-
return [logicalOp, ...children];
|
|
6098
|
-
}
|
|
6099
|
-
function propertiesFilterToExpression(filters) {
|
|
6100
|
-
if (!(filters == null ? void 0 : filters.length)) {
|
|
6101
|
-
return [];
|
|
6102
|
-
}
|
|
6103
|
-
return toGroupExpr(filters);
|
|
6104
|
-
}
|
|
6105
|
-
function propertiesFilterToExpressionString(filters) {
|
|
6106
|
-
if (!(filters == null ? void 0 : filters.length)) {
|
|
6107
|
-
return void 0;
|
|
6108
|
-
}
|
|
6109
|
-
return JSON.stringify(
|
|
6110
|
-
propertiesFilterToExpression(filters)
|
|
6111
|
-
);
|
|
6112
|
-
}
|
|
6113
|
-
|
|
6114
6022
|
function createLayerFilterParam(resourceId, filter) {
|
|
6023
|
+
const value = propertiesFilterToExpressionString(filter);
|
|
6024
|
+
if (value === void 0) {
|
|
6025
|
+
return {};
|
|
6026
|
+
}
|
|
6115
6027
|
return {
|
|
6116
|
-
[`filter[${resourceId}]`]:
|
|
6028
|
+
[`filter[${resourceId}]`]: value
|
|
6117
6029
|
};
|
|
6118
6030
|
}
|
|
6119
6031
|
|
|
@@ -6201,7 +6113,7 @@ function createRasterAdapter(_0) {
|
|
|
6201
6113
|
return class RasterAdapter extends AdapterClass {
|
|
6202
6114
|
constructor(map, _options) {
|
|
6203
6115
|
super(map, _options);
|
|
6204
|
-
this
|
|
6116
|
+
__publicField$c(this, "map", map);
|
|
6205
6117
|
__publicField$c(this, "item", item);
|
|
6206
6118
|
__publicField$c(this, "resourceId", resourceId);
|
|
6207
6119
|
__publicField$c(this, "blocked", false);
|
|
@@ -6499,7 +6411,7 @@ var __async$a = (__this, __arguments, generator) => {
|
|
|
6499
6411
|
};
|
|
6500
6412
|
class NgwKit {
|
|
6501
6413
|
constructor(options) {
|
|
6502
|
-
this
|
|
6414
|
+
__publicField$b(this, "options", options);
|
|
6503
6415
|
__publicField$b(this, "url");
|
|
6504
6416
|
__publicField$b(this, "connector");
|
|
6505
6417
|
__publicField$b(this, "webMap");
|
|
@@ -8187,7 +8099,7 @@ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key,
|
|
|
8187
8099
|
var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8188
8100
|
class StateItem {
|
|
8189
8101
|
constructor(webMap, opt) {
|
|
8190
|
-
this
|
|
8102
|
+
__publicField$7(this, "webMap", webMap);
|
|
8191
8103
|
__publicField$7(this, "name");
|
|
8192
8104
|
__publicField$7(this, "event");
|
|
8193
8105
|
__publicField$7(this, "value");
|
|
@@ -9979,7 +9891,7 @@ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
|
9979
9891
|
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
9980
9892
|
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
9981
9893
|
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
9982
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
9894
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
9983
9895
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9984
9896
|
var __spreadValues$3 = (a, b) => {
|
|
9985
9897
|
for (var prop in b || (b = {}))
|