@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
|
@@ -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
|
import { EventEmitter } from 'events';
|
|
3
3
|
import CancelablePromise from '@nextgis/cancelable-promise';
|
|
4
4
|
import { getIcon } from '@nextgis/icons';
|
package/lib/ngw-map.global.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 NgwMap = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1406,7 +1406,10 @@ var NgwMap = (function (exports) {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
return CancelablePromise.resolve(void 0);
|
|
1408
1408
|
};
|
|
1409
|
-
|
|
1409
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
1410
|
+
return cache.addFull("resource", makeRequest, forCache);
|
|
1411
|
+
}
|
|
1412
|
+
return makeRequest();
|
|
1410
1413
|
}
|
|
1411
1414
|
getOneOrFail(resource, requestOptions) {
|
|
1412
1415
|
return this.getOne(resource, requestOptions).then((res) => {
|
|
@@ -1567,14 +1570,17 @@ var NgwMap = (function (exports) {
|
|
|
1567
1570
|
}
|
|
1568
1571
|
_fetchResourceById(id, requestOptions) {
|
|
1569
1572
|
const promise = () => this.connector.get("resource.item", requestOptions, { id });
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1573
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
1574
|
+
return this.cache.add("resource.item", promise, {
|
|
1575
|
+
id
|
|
1576
|
+
}).catch((er) => {
|
|
1577
|
+
if (!(er instanceof ResourceNotFoundError)) {
|
|
1578
|
+
throw er;
|
|
1579
|
+
}
|
|
1580
|
+
return void 0;
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
return promise();
|
|
1578
1584
|
}
|
|
1579
1585
|
_fetchResourceBy(resource, requestOptions) {
|
|
1580
1586
|
return this.getMany(resource, requestOptions).then((resources) => {
|
|
@@ -1654,7 +1660,7 @@ var NgwMap = (function (exports) {
|
|
|
1654
1660
|
function apiRequest(opt) {
|
|
1655
1661
|
const params = opt.params;
|
|
1656
1662
|
return new CancelablePromise((resolve, reject) => {
|
|
1657
|
-
opt.connector.connect().then((apiItems) => {
|
|
1663
|
+
return opt.connector.connect().then((apiItems) => {
|
|
1658
1664
|
let apiItem = apiItems && apiItems[opt.name];
|
|
1659
1665
|
if (apiItem) {
|
|
1660
1666
|
apiItem = [...apiItem];
|
|
@@ -2466,7 +2472,9 @@ var NgwMap = (function (exports) {
|
|
|
2466
2472
|
return [`${isFldStr}${field_}__${operation}`, v];
|
|
2467
2473
|
}
|
|
2468
2474
|
function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
2475
|
+
var _a;
|
|
2469
2476
|
const { filters } = opt;
|
|
2477
|
+
const paramList = (_a = opt.paramList) != null ? _a : [];
|
|
2470
2478
|
const logic = typeof filters[0] === "string" ? filters[0] : "all";
|
|
2471
2479
|
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
2472
2480
|
if (logic === "any") {
|
|
@@ -2474,7 +2482,7 @@ var NgwMap = (function (exports) {
|
|
|
2474
2482
|
if (isPropertyFilter(f)) {
|
|
2475
2483
|
_queries.push(
|
|
2476
2484
|
fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
|
|
2477
|
-
paramList: [..._parentAllParams, createParam(f)]
|
|
2485
|
+
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
2478
2486
|
}))
|
|
2479
2487
|
);
|
|
2480
2488
|
} else {
|
|
@@ -2510,7 +2518,7 @@ var NgwMap = (function (exports) {
|
|
|
2510
2518
|
} else {
|
|
2511
2519
|
_queries.push(
|
|
2512
2520
|
fetchNgwLayerItemsRequest(__spreadProps$c(__spreadValues$q({}, opt), {
|
|
2513
|
-
paramList: [..._parentAllParams, ...filters2]
|
|
2521
|
+
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
2514
2522
|
}))
|
|
2515
2523
|
);
|
|
2516
2524
|
}
|