@nextgis/ngw-map 1.11.8 → 1.11.9
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 +20 -16
- 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 +28 -23
- 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 +3 -3
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 1.11.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 1.11.9; author: NextGIS */
|
|
2
2
|
var events = {exports: {}};
|
|
3
3
|
|
|
4
4
|
var R = typeof Reflect === 'object' ? Reflect : null;
|
|
@@ -4688,7 +4688,19 @@ function updateItemRequestParam(params, options) {
|
|
|
4688
4688
|
}
|
|
4689
4689
|
// NGW REST API is not able to filtering by combined queries
|
|
4690
4690
|
// therefore the filter is divided into several requests
|
|
4691
|
-
function createFeatureFieldFilterQueries(opt
|
|
4691
|
+
function createFeatureFieldFilterQueries(opt) {
|
|
4692
|
+
const queries = getQueries(opt);
|
|
4693
|
+
return CancelablePromise.all(queries).then((itemsParts) => {
|
|
4694
|
+
const items = itemsParts.reduce((a, b) => a.concat(b), []);
|
|
4695
|
+
const offset = opt.offset !== undefined ? opt.offset : 0;
|
|
4696
|
+
const limit = opt.limit !== undefined ? opt.limit : items.length;
|
|
4697
|
+
if (opt.offset || opt.limit) {
|
|
4698
|
+
return items.splice(offset, limit);
|
|
4699
|
+
}
|
|
4700
|
+
return items;
|
|
4701
|
+
});
|
|
4702
|
+
}
|
|
4703
|
+
function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
4692
4704
|
const { filters } = opt;
|
|
4693
4705
|
const logic = typeof filters[0] === 'string' ? filters[0] : 'all';
|
|
4694
4706
|
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
@@ -4708,7 +4720,7 @@ function createFeatureFieldFilterQueries(opt, _queries = [], _parentAllParams =
|
|
|
4708
4720
|
return [`${isFldStr}${field_}__${operation}`, v];
|
|
4709
4721
|
};
|
|
4710
4722
|
if (logic === 'any') {
|
|
4711
|
-
|
|
4723
|
+
for (const f of filters_) {
|
|
4712
4724
|
if (isPropertyFilter(f)) {
|
|
4713
4725
|
_queries.push(fetchNgwLayerItemsRequest({
|
|
4714
4726
|
...opt,
|
|
@@ -4716,12 +4728,12 @@ function createFeatureFieldFilterQueries(opt, _queries = [], _parentAllParams =
|
|
|
4716
4728
|
}));
|
|
4717
4729
|
}
|
|
4718
4730
|
else {
|
|
4719
|
-
|
|
4731
|
+
getQueries({
|
|
4720
4732
|
...opt,
|
|
4721
4733
|
filters: f,
|
|
4722
4734
|
}, _queries, [..._parentAllParams]);
|
|
4723
4735
|
}
|
|
4724
|
-
}
|
|
4736
|
+
}
|
|
4725
4737
|
}
|
|
4726
4738
|
else if (logic === 'all') {
|
|
4727
4739
|
const filters = [];
|
|
@@ -4736,7 +4748,7 @@ function createFeatureFieldFilterQueries(opt, _queries = [], _parentAllParams =
|
|
|
4736
4748
|
}
|
|
4737
4749
|
if (propertiesFilterList.length) {
|
|
4738
4750
|
for (const x of propertiesFilterList) {
|
|
4739
|
-
|
|
4751
|
+
getQueries({
|
|
4740
4752
|
...opt,
|
|
4741
4753
|
filters: x,
|
|
4742
4754
|
}, _queries, [..._parentAllParams, ...filters]);
|
|
@@ -4749,15 +4761,7 @@ function createFeatureFieldFilterQueries(opt, _queries = [], _parentAllParams =
|
|
|
4749
4761
|
}));
|
|
4750
4762
|
}
|
|
4751
4763
|
}
|
|
4752
|
-
return
|
|
4753
|
-
const items = itemsParts.reduce((a, b) => a.concat(b), []);
|
|
4754
|
-
const offset = opt.offset !== undefined ? opt.offset : 0;
|
|
4755
|
-
const limit = opt.limit !== undefined ? opt.limit : items.length;
|
|
4756
|
-
if (opt.offset || opt.limit) {
|
|
4757
|
-
return items.splice(offset, limit);
|
|
4758
|
-
}
|
|
4759
|
-
return items;
|
|
4760
|
-
});
|
|
4764
|
+
return _queries;
|
|
4761
4765
|
}
|
|
4762
4766
|
function createWktFromCoordArray(coord) {
|
|
4763
4767
|
const polygon = coord.map(([lng, lat]) => {
|
|
@@ -4839,7 +4843,7 @@ function fetchNgwLayerItems(options) {
|
|
|
4839
4843
|
filters,
|
|
4840
4844
|
}).then((data) => {
|
|
4841
4845
|
// Additional client-side filter check
|
|
4842
|
-
data.filter((y) => {
|
|
4846
|
+
data = data.filter((y) => {
|
|
4843
4847
|
const fields = prepareNgwFieldsToPropertiesFilter({ ...y.fields });
|
|
4844
4848
|
const result = propertiesFilter(fields, filters);
|
|
4845
4849
|
return result;
|