@nextgis/ngw-map 2.3.0 → 2.4.1
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 +1 -1
- package/lib/ngw-map.esm-browser.js +21 -13
- 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 +21 -13
- 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 +4 -4
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 2.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 2.4.1; author: NextGIS */
|
|
2
2
|
var domain;
|
|
3
3
|
|
|
4
4
|
// This constructor is used to store event handlers. Instantiating this is
|
|
@@ -1403,7 +1403,10 @@ class ResourcesControl {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
return CancelablePromise.resolve(void 0);
|
|
1405
1405
|
};
|
|
1406
|
-
|
|
1406
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
1407
|
+
return cache.addFull("resource", makeRequest, forCache);
|
|
1408
|
+
}
|
|
1409
|
+
return makeRequest();
|
|
1407
1410
|
}
|
|
1408
1411
|
getOneOrFail(resource, requestOptions) {
|
|
1409
1412
|
return this.getOne(resource, requestOptions).then((res) => {
|
|
@@ -1564,14 +1567,17 @@ class ResourcesControl {
|
|
|
1564
1567
|
}
|
|
1565
1568
|
_fetchResourceById(id, requestOptions) {
|
|
1566
1569
|
const promise = () => this.connector.get("resource.item", requestOptions, { id });
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1570
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
1571
|
+
return this.cache.add("resource.item", promise, {
|
|
1572
|
+
id
|
|
1573
|
+
}).catch((er) => {
|
|
1574
|
+
if (!(er instanceof ResourceNotFoundError)) {
|
|
1575
|
+
throw er;
|
|
1576
|
+
}
|
|
1577
|
+
return void 0;
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
return promise();
|
|
1575
1581
|
}
|
|
1576
1582
|
_fetchResourceBy(resource, requestOptions) {
|
|
1577
1583
|
return this.getMany(resource, requestOptions).then((resources) => {
|
|
@@ -1651,7 +1657,7 @@ function template(str, data) {
|
|
|
1651
1657
|
function apiRequest(opt) {
|
|
1652
1658
|
const params = opt.params;
|
|
1653
1659
|
return new CancelablePromise((resolve, reject) => {
|
|
1654
|
-
opt.connector.connect().then((apiItems) => {
|
|
1660
|
+
return opt.connector.connect().then((apiItems) => {
|
|
1655
1661
|
let apiItem = apiItems && apiItems[opt.name];
|
|
1656
1662
|
if (apiItem) {
|
|
1657
1663
|
apiItem = [...apiItem];
|
|
@@ -2463,7 +2469,9 @@ function createParam(pf) {
|
|
|
2463
2469
|
return [`${isFldStr}${field_}__${operation}`, v];
|
|
2464
2470
|
}
|
|
2465
2471
|
function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
2472
|
+
var _a;
|
|
2466
2473
|
const { filters } = opt;
|
|
2474
|
+
const paramList = (_a = opt.paramList) != null ? _a : [];
|
|
2467
2475
|
const logic = typeof filters[0] === "string" ? filters[0] : "all";
|
|
2468
2476
|
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
2469
2477
|
if (logic === "any") {
|
|
@@ -2471,7 +2479,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
2471
2479
|
if (isPropertyFilter(f)) {
|
|
2472
2480
|
_queries.push(
|
|
2473
2481
|
fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
|
|
2474
|
-
paramList: [..._parentAllParams, createParam(f)]
|
|
2482
|
+
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
2475
2483
|
}))
|
|
2476
2484
|
);
|
|
2477
2485
|
} else {
|
|
@@ -2507,7 +2515,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
2507
2515
|
} else {
|
|
2508
2516
|
_queries.push(
|
|
2509
2517
|
fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
|
|
2510
|
-
paramList: [..._parentAllParams, ...filters2]
|
|
2518
|
+
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
2511
2519
|
}))
|
|
2512
2520
|
);
|
|
2513
2521
|
}
|