@nextgis/ngw-leaflet 3.0.1 → 3.1.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-leaflet.esm-browser.js +212 -94
- package/lib/ngw-leaflet.esm-browser.js.map +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js +2 -2
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.js +1 -1
- package/lib/ngw-leaflet.esm-bundler.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-leaflet.global.js +212 -94
- package/lib/ngw-leaflet.global.js.map +1 -1
- package/lib/ngw-leaflet.global.prod.js +2 -2
- package/lib/ngw-leaflet.global.prod.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-leaflet; version: 3.
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 3.1.1; author: NextGIS */
|
|
2
2
|
var domain;
|
|
3
3
|
|
|
4
4
|
// This constructor is used to store event handlers. Instantiating this is
|
|
@@ -29,7 +29,9 @@ EventEmitter.init = function() {
|
|
|
29
29
|
this.domain = null;
|
|
30
30
|
if (EventEmitter.usingDomains) {
|
|
31
31
|
// if there is an active domain, then attach to it.
|
|
32
|
-
if (domain.active)
|
|
32
|
+
if (domain.active && !(this instanceof domain.Domain)) {
|
|
33
|
+
this.domain = domain.active;
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
|
|
@@ -15943,7 +15945,7 @@ const operationsAliases = {
|
|
|
15943
15945
|
return like(a, b, true);
|
|
15944
15946
|
}
|
|
15945
15947
|
};
|
|
15946
|
-
function isPropertyFilter(filter) {
|
|
15948
|
+
function isPropertyFilter$1(filter) {
|
|
15947
15949
|
const pf = filter;
|
|
15948
15950
|
if (pf.length === 3 && typeof pf[0] === "string" && typeof pf[1] === "string") {
|
|
15949
15951
|
return true;
|
|
@@ -15961,7 +15963,7 @@ function featureFilter(feature, filters) {
|
|
|
15961
15963
|
function propertiesFilter(properties, filters) {
|
|
15962
15964
|
const logic = typeof filters[0] === "string" ? filters[0] : "all";
|
|
15963
15965
|
const filterFunction = (p) => {
|
|
15964
|
-
if (isPropertyFilter(p)) {
|
|
15966
|
+
if (isPropertyFilter$1(p)) {
|
|
15965
15967
|
const [field, operation, value] = p;
|
|
15966
15968
|
const operationExec = operationsAliases[operation];
|
|
15967
15969
|
if (operationExec) {
|
|
@@ -16160,7 +16162,7 @@ var __spreadValues$C = (a, b) => {
|
|
|
16160
16162
|
return a;
|
|
16161
16163
|
};
|
|
16162
16164
|
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
|
16163
|
-
var __objRest$
|
|
16165
|
+
var __objRest$9 = (source, exclude) => {
|
|
16164
16166
|
var target = {};
|
|
16165
16167
|
for (var prop in source)
|
|
16166
16168
|
if (__hasOwnProp$D.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -16243,7 +16245,7 @@ class GeoJsonPaint {
|
|
|
16243
16245
|
return PAINT;
|
|
16244
16246
|
}
|
|
16245
16247
|
_createDivIcon(icon) {
|
|
16246
|
-
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$
|
|
16248
|
+
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$9(_a, ["html", "rotate", "className"]);
|
|
16247
16249
|
const element = document.createElement("div");
|
|
16248
16250
|
if (className) {
|
|
16249
16251
|
element.className = className;
|
|
@@ -17368,7 +17370,7 @@ var __spreadValues$z = (a, b) => {
|
|
|
17368
17370
|
return a;
|
|
17369
17371
|
};
|
|
17370
17372
|
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
17371
|
-
var __objRest$
|
|
17373
|
+
var __objRest$8 = (source, exclude) => {
|
|
17372
17374
|
var target = {};
|
|
17373
17375
|
for (var prop in source)
|
|
17374
17376
|
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -17384,7 +17386,7 @@ class TileAdapter extends BaseAdapter {
|
|
|
17384
17386
|
addLayer(options) {
|
|
17385
17387
|
this.options = Object.assign(this.options, options);
|
|
17386
17388
|
if (options) {
|
|
17387
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17389
|
+
const _a = options, { url } = _a, opt = __objRest$8(_a, ["url"]);
|
|
17388
17390
|
if (url) {
|
|
17389
17391
|
const tileLayerOptions = __spreadValues$z({
|
|
17390
17392
|
pane: this.pane,
|
|
@@ -17477,7 +17479,7 @@ var __spreadValues$x = (a, b) => {
|
|
|
17477
17479
|
return a;
|
|
17478
17480
|
};
|
|
17479
17481
|
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
17480
|
-
var __objRest$
|
|
17482
|
+
var __objRest$7 = (source, exclude) => {
|
|
17481
17483
|
var target = {};
|
|
17482
17484
|
for (var prop in source)
|
|
17483
17485
|
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -17492,7 +17494,7 @@ var __objRest$6 = (source, exclude) => {
|
|
|
17492
17494
|
class WmsAdapter extends BaseAdapter {
|
|
17493
17495
|
addLayer(options) {
|
|
17494
17496
|
Object.assign(this.options, options);
|
|
17495
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17497
|
+
const _a = options, { url } = _a, opt = __objRest$7(_a, ["url"]);
|
|
17496
17498
|
if (url) {
|
|
17497
17499
|
const layerOptions = __spreadValues$x({
|
|
17498
17500
|
pane: this.pane,
|
|
@@ -18186,63 +18188,7 @@ __publicField$A(_Cache, "instance", {});
|
|
|
18186
18188
|
let Cache = _Cache;
|
|
18187
18189
|
|
|
18188
18190
|
var pkg = {
|
|
18189
|
-
|
|
18190
|
-
version: "3.0.1",
|
|
18191
|
-
_priority: 12,
|
|
18192
|
-
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
18193
|
-
main: "index.js",
|
|
18194
|
-
module: "lib/ngw-connector.esm-bundler.js",
|
|
18195
|
-
unpkg: "lib/ngw-connector.global.prod.js",
|
|
18196
|
-
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
18197
|
-
types: "lib/index.d.ts",
|
|
18198
|
-
dependencies: {
|
|
18199
|
-
"@nextgis/cache": "3.0.0",
|
|
18200
|
-
"@nextgis/cancelable-promise": "3.0.0",
|
|
18201
|
-
"@nextgis/utils": "3.0.0",
|
|
18202
|
-
"@types/events": "^3.0.0",
|
|
18203
|
-
events: "*",
|
|
18204
|
-
"form-data": "^4.0.0"
|
|
18205
|
-
},
|
|
18206
|
-
devDependencies: {
|
|
18207
|
-
"@nextgis/build-tools": "3.0.0"
|
|
18208
|
-
},
|
|
18209
|
-
scripts: {
|
|
18210
|
-
clean: "rimraf ./lib",
|
|
18211
|
-
dev: "node ../build-tools/lib/build.js",
|
|
18212
|
-
prod: "npm run dev -- --release",
|
|
18213
|
-
lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
|
|
18214
|
-
watch: "npm run dev -- --watch",
|
|
18215
|
-
"gen:types": "node ./scripts/generator"
|
|
18216
|
-
},
|
|
18217
|
-
buildOptions: {
|
|
18218
|
-
name: "NgwConnector",
|
|
18219
|
-
formats: [
|
|
18220
|
-
"esm-bundler",
|
|
18221
|
-
"esm-browser",
|
|
18222
|
-
"cjs",
|
|
18223
|
-
"global"
|
|
18224
|
-
]
|
|
18225
|
-
},
|
|
18226
|
-
keywords: [
|
|
18227
|
-
"NextGIS",
|
|
18228
|
-
"MAP"
|
|
18229
|
-
],
|
|
18230
|
-
author: "NextGIS",
|
|
18231
|
-
files: [
|
|
18232
|
-
"index.js",
|
|
18233
|
-
"lib"
|
|
18234
|
-
],
|
|
18235
|
-
license: "MIT",
|
|
18236
|
-
homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
|
|
18237
|
-
repository: {
|
|
18238
|
-
type: "git",
|
|
18239
|
-
url: "git://github.com/nextgis/nextgis_frontend.git"
|
|
18240
|
-
},
|
|
18241
|
-
engines: {
|
|
18242
|
-
node: ">=18.20.4"
|
|
18243
|
-
},
|
|
18244
|
-
gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
|
|
18245
|
-
};
|
|
18191
|
+
version: "3.1.1"};
|
|
18246
18192
|
|
|
18247
18193
|
class AbortError extends Error {
|
|
18248
18194
|
constructor(message = "AbortError") {
|
|
@@ -18444,7 +18390,7 @@ var __spreadValues$u = (a, b) => {
|
|
|
18444
18390
|
}
|
|
18445
18391
|
return a;
|
|
18446
18392
|
};
|
|
18447
|
-
var __objRest$
|
|
18393
|
+
var __objRest$6 = (source, exclude) => {
|
|
18448
18394
|
var target = {};
|
|
18449
18395
|
for (var prop in source)
|
|
18450
18396
|
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -18598,7 +18544,7 @@ function request(path, options, cacheEngine) {
|
|
|
18598
18544
|
cache,
|
|
18599
18545
|
query,
|
|
18600
18546
|
json
|
|
18601
|
-
} = _a, opt = __objRest$
|
|
18547
|
+
} = _a, opt = __objRest$6(_a, [
|
|
18602
18548
|
"withCredentials",
|
|
18603
18549
|
"responseType",
|
|
18604
18550
|
"cacheProps",
|
|
@@ -18708,7 +18654,7 @@ var __spreadValues$t = (a, b) => {
|
|
|
18708
18654
|
return a;
|
|
18709
18655
|
};
|
|
18710
18656
|
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
18711
|
-
var __objRest$
|
|
18657
|
+
var __objRest$5 = (source, exclude) => {
|
|
18712
18658
|
var target = {};
|
|
18713
18659
|
for (var prop in source)
|
|
18714
18660
|
if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -18787,7 +18733,7 @@ function route(name, connector, ...rest) {
|
|
|
18787
18733
|
for (const method of methods) {
|
|
18788
18734
|
const methodResp = (requestOptions) => {
|
|
18789
18735
|
var _b;
|
|
18790
|
-
const _a = requestOptions || {}, { headers: optHeaders } = _a, restOpt = __objRest$
|
|
18736
|
+
const _a = requestOptions || {}, { headers: optHeaders } = _a, restOpt = __objRest$5(_a, ["headers"]);
|
|
18791
18737
|
if ((_b = requestOptions == null ? void 0 : requestOptions.signal) == null ? void 0 : _b.aborted) {
|
|
18792
18738
|
throw new AbortError();
|
|
18793
18739
|
}
|
|
@@ -18945,7 +18891,7 @@ var __spreadValues$s = (a, b) => {
|
|
|
18945
18891
|
return a;
|
|
18946
18892
|
};
|
|
18947
18893
|
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
18948
|
-
var __objRest$
|
|
18894
|
+
var __objRest$4 = (source, exclude) => {
|
|
18949
18895
|
var target = {};
|
|
18950
18896
|
for (var prop in source)
|
|
18951
18897
|
if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -19153,7 +19099,7 @@ class NgwConnector {
|
|
|
19153
19099
|
throw new Error("Empty `url` not allowed");
|
|
19154
19100
|
}
|
|
19155
19101
|
if (params) {
|
|
19156
|
-
const _a = params, restParams = __objRest$
|
|
19102
|
+
const _a = params, { paramList } = _a, restParams = __objRest$4(_a, ["paramList"]);
|
|
19157
19103
|
url = template(url, restParams);
|
|
19158
19104
|
}
|
|
19159
19105
|
url = encodeURI(fixUrlStr(url));
|
|
@@ -19443,8 +19389,9 @@ class ResourcesControl {
|
|
|
19443
19389
|
query: __spreadValues$r({
|
|
19444
19390
|
serialization: "full"
|
|
19445
19391
|
}, query)
|
|
19446
|
-
})).then((
|
|
19447
|
-
|
|
19392
|
+
})).then((response) => {
|
|
19393
|
+
const resources = Array.isArray(response) ? response : response.items;
|
|
19394
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
19448
19395
|
for (const x of resources) {
|
|
19449
19396
|
this.cache.add("resource.item", Promise.resolve(x), {
|
|
19450
19397
|
id: x.resource.id
|
|
@@ -20300,7 +20247,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
20300
20247
|
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
20301
20248
|
if (logic === "any") {
|
|
20302
20249
|
for (const f of filters_) {
|
|
20303
|
-
if (isPropertyFilter(f)) {
|
|
20250
|
+
if (isPropertyFilter$1(f)) {
|
|
20304
20251
|
_queries.push(
|
|
20305
20252
|
fetchNgwLayerItemsRequest(__spreadProps$g(__spreadValues$o({}, opt), {
|
|
20306
20253
|
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
@@ -20314,7 +20261,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
20314
20261
|
const filters2 = [];
|
|
20315
20262
|
const propertiesFilterList = [];
|
|
20316
20263
|
for (const f of filters_) {
|
|
20317
|
-
if (isPropertyFilter(f)) {
|
|
20264
|
+
if (isPropertyFilter$1(f)) {
|
|
20318
20265
|
filters2.push(createParam(f));
|
|
20319
20266
|
} else {
|
|
20320
20267
|
propertiesFilterList.push(f);
|
|
@@ -22131,7 +22078,7 @@ var __spreadValues$e = (a, b) => {
|
|
|
22131
22078
|
return a;
|
|
22132
22079
|
};
|
|
22133
22080
|
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
22134
|
-
var __objRest$
|
|
22081
|
+
var __objRest$3 = (source, exclude) => {
|
|
22135
22082
|
var target = {};
|
|
22136
22083
|
for (var prop in source)
|
|
22137
22084
|
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -22144,7 +22091,7 @@ var __objRest$2 = (source, exclude) => {
|
|
|
22144
22091
|
return target;
|
|
22145
22092
|
};
|
|
22146
22093
|
function updateImageParams(params, resourceId) {
|
|
22147
|
-
const _a = params, { bbox, width, height, nd } = _a, rest = __objRest$
|
|
22094
|
+
const _a = params, { bbox, width, height, nd } = _a, rest = __objRest$3(_a, ["bbox", "width", "height", "nd"]);
|
|
22148
22095
|
return __spreadProps$a(__spreadValues$e({}, rest), {
|
|
22149
22096
|
resource: Array.isArray(resourceId) ? resourceId.join(",") : resourceId,
|
|
22150
22097
|
extent: bbox,
|
|
@@ -22275,7 +22222,7 @@ var __spreadValues$d = (a, b) => {
|
|
|
22275
22222
|
}
|
|
22276
22223
|
return a;
|
|
22277
22224
|
};
|
|
22278
|
-
var __objRest$
|
|
22225
|
+
var __objRest$2 = (source, exclude) => {
|
|
22279
22226
|
var target = {};
|
|
22280
22227
|
for (var prop in source)
|
|
22281
22228
|
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -22312,7 +22259,7 @@ const URL$1 = "https://qms.nextgis.com";
|
|
|
22312
22259
|
function createQmsAdapter(webMapOrOptions, url = URL$1, createOpt = {}) {
|
|
22313
22260
|
let webMap;
|
|
22314
22261
|
if ("webMap" in webMapOrOptions) {
|
|
22315
|
-
const _a = webMapOrOptions, { webMap: webMap_, url: url_ } = _a, adapterOptions = __objRest$
|
|
22262
|
+
const _a = webMapOrOptions, { webMap: webMap_, url: url_ } = _a, adapterOptions = __objRest$2(_a, ["webMap", "url"]);
|
|
22316
22263
|
webMap = webMap_;
|
|
22317
22264
|
if (url_) {
|
|
22318
22265
|
url = url_;
|
|
@@ -22474,9 +22421,9 @@ function createBasemapLayerAdapter(_0) {
|
|
|
22474
22421
|
item
|
|
22475
22422
|
}) {
|
|
22476
22423
|
if (item.basemap_layer) {
|
|
22477
|
-
const
|
|
22478
|
-
const url =
|
|
22479
|
-
if (qms) {
|
|
22424
|
+
const basemap = item.basemap_layer;
|
|
22425
|
+
const { qms, url } = basemap;
|
|
22426
|
+
if (qms && typeof qms === "string") {
|
|
22480
22427
|
const qms_ = JSON.parse(qms);
|
|
22481
22428
|
const adapter = Promise.resolve(
|
|
22482
22429
|
QmsKit.utils.createQmsAdapter(webMap, void 0, {
|
|
@@ -22489,10 +22436,19 @@ function createBasemapLayerAdapter(_0) {
|
|
|
22489
22436
|
const TileAdapter = webMap.mapAdapter.layerAdapters.TILE;
|
|
22490
22437
|
if (TileAdapter) {
|
|
22491
22438
|
class BasemapTileAdapter extends TileAdapter {
|
|
22439
|
+
constructor(map, options) {
|
|
22440
|
+
super(map, __spreadProps$9(__spreadValues$b({}, options), { baselayer: true, order: 0 }));
|
|
22441
|
+
}
|
|
22492
22442
|
addLayer(opt) {
|
|
22493
22443
|
return __async$f(this, null, function* () {
|
|
22444
|
+
var _a, _b, _c;
|
|
22494
22445
|
if (url) {
|
|
22495
|
-
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$9(__spreadValues$b({}, opt), {
|
|
22446
|
+
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$9(__spreadValues$b({}, opt), {
|
|
22447
|
+
url,
|
|
22448
|
+
minZoom: (_a = basemap.z_min) != null ? _a : opt.minZoom,
|
|
22449
|
+
maxZoom: (_b = basemap.z_max) != null ? _b : opt.maxZoom,
|
|
22450
|
+
attribution: (_c = basemap.copyright_text) != null ? _c : opt.attribution
|
|
22451
|
+
}));
|
|
22496
22452
|
}
|
|
22497
22453
|
});
|
|
22498
22454
|
}
|
|
@@ -22953,6 +22909,134 @@ function createWebMapAdapter(_0) {
|
|
|
22953
22909
|
});
|
|
22954
22910
|
}
|
|
22955
22911
|
|
|
22912
|
+
function isPropertyFilter(value) {
|
|
22913
|
+
return Array.isArray(value) && value.length === 3 && typeof value[0] === "string" && typeof value[1] === "string";
|
|
22914
|
+
}
|
|
22915
|
+
function isPropertiesFilterGroup(value) {
|
|
22916
|
+
return Array.isArray(value) && !isPropertyFilter(value);
|
|
22917
|
+
}
|
|
22918
|
+
function toGetExpr(field) {
|
|
22919
|
+
return ["get", field];
|
|
22920
|
+
}
|
|
22921
|
+
function toConditionExpr(filter) {
|
|
22922
|
+
const [fieldRaw, op, value] = filter;
|
|
22923
|
+
const field = String(fieldRaw);
|
|
22924
|
+
const getExpr = toGetExpr(field);
|
|
22925
|
+
switch (op) {
|
|
22926
|
+
case "eq":
|
|
22927
|
+
if (value === null) {
|
|
22928
|
+
return ["is_null", getExpr];
|
|
22929
|
+
}
|
|
22930
|
+
return ["==", getExpr, value];
|
|
22931
|
+
case "ne":
|
|
22932
|
+
if (value === null) {
|
|
22933
|
+
return ["!is_null", getExpr];
|
|
22934
|
+
}
|
|
22935
|
+
return ["!=", getExpr, value];
|
|
22936
|
+
case "gt":
|
|
22937
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
22938
|
+
throw new Error(
|
|
22939
|
+
`Operator "gt" requires number or string for "${field}"`
|
|
22940
|
+
);
|
|
22941
|
+
}
|
|
22942
|
+
return [">", getExpr, value];
|
|
22943
|
+
case "lt":
|
|
22944
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
22945
|
+
throw new Error(
|
|
22946
|
+
`Operator "lt" requires number or string for "${field}"`
|
|
22947
|
+
);
|
|
22948
|
+
}
|
|
22949
|
+
return ["<", getExpr, value];
|
|
22950
|
+
case "ge":
|
|
22951
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
22952
|
+
throw new Error(
|
|
22953
|
+
`Operator "ge" requires number or string for "${field}"`
|
|
22954
|
+
);
|
|
22955
|
+
}
|
|
22956
|
+
return [">=", getExpr, value];
|
|
22957
|
+
case "le":
|
|
22958
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
22959
|
+
throw new Error(
|
|
22960
|
+
`Operator "le" requires number or string for "${field}"`
|
|
22961
|
+
);
|
|
22962
|
+
}
|
|
22963
|
+
return ["<=", getExpr, value];
|
|
22964
|
+
case "in":
|
|
22965
|
+
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
22966
|
+
throw new Error(
|
|
22967
|
+
`Operator "in" requires (string | number)[] for "${field}"`
|
|
22968
|
+
);
|
|
22969
|
+
}
|
|
22970
|
+
if (!value.length) {
|
|
22971
|
+
throw new Error(
|
|
22972
|
+
`Operator "in" requires non-empty array for "${field}"`
|
|
22973
|
+
);
|
|
22974
|
+
}
|
|
22975
|
+
return ["in", getExpr, ...value];
|
|
22976
|
+
case "notin":
|
|
22977
|
+
if (!Array.isArray(value) || !value.every((x) => typeof x === "string" || typeof x === "number")) {
|
|
22978
|
+
throw new Error(
|
|
22979
|
+
`Operator "notin" requires (string | number)[] for "${field}"`
|
|
22980
|
+
);
|
|
22981
|
+
}
|
|
22982
|
+
if (!value.length) {
|
|
22983
|
+
throw new Error(
|
|
22984
|
+
`Operator "notin" requires non-empty array for "${field}"`
|
|
22985
|
+
);
|
|
22986
|
+
}
|
|
22987
|
+
return ["!in", getExpr, ...value];
|
|
22988
|
+
case "like":
|
|
22989
|
+
case "ilike":
|
|
22990
|
+
throw new Error(
|
|
22991
|
+
`Operator "${op}" is not supported by server FilterExpression`
|
|
22992
|
+
);
|
|
22993
|
+
default: {
|
|
22994
|
+
const exhaustive = op;
|
|
22995
|
+
throw new Error(`Unsupported operator: ${exhaustive}`);
|
|
22996
|
+
}
|
|
22997
|
+
}
|
|
22998
|
+
}
|
|
22999
|
+
function toGroupExpr(filters) {
|
|
23000
|
+
let logicalOp = "all";
|
|
23001
|
+
const children = [];
|
|
23002
|
+
for (const item of filters) {
|
|
23003
|
+
if (item === "all" || item === "any") {
|
|
23004
|
+
logicalOp = item;
|
|
23005
|
+
continue;
|
|
23006
|
+
}
|
|
23007
|
+
if (isPropertyFilter(item)) {
|
|
23008
|
+
children.push(toConditionExpr(item));
|
|
23009
|
+
continue;
|
|
23010
|
+
}
|
|
23011
|
+
if (isPropertiesFilterGroup(item)) {
|
|
23012
|
+
children.push(toGroupExpr(item));
|
|
23013
|
+
continue;
|
|
23014
|
+
}
|
|
23015
|
+
throw new Error("Invalid PropertiesFilter node");
|
|
23016
|
+
}
|
|
23017
|
+
return [logicalOp, ...children];
|
|
23018
|
+
}
|
|
23019
|
+
function propertiesFilterToExpression(filters) {
|
|
23020
|
+
if (!(filters == null ? void 0 : filters.length)) {
|
|
23021
|
+
return [];
|
|
23022
|
+
}
|
|
23023
|
+
return toGroupExpr(filters);
|
|
23024
|
+
}
|
|
23025
|
+
function propertiesFilterToExpressionString(filters) {
|
|
23026
|
+
if (!(filters == null ? void 0 : filters.length)) {
|
|
23027
|
+
return void 0;
|
|
23028
|
+
}
|
|
23029
|
+
return JSON.stringify(
|
|
23030
|
+
propertiesFilterToExpression(filters)
|
|
23031
|
+
);
|
|
23032
|
+
}
|
|
23033
|
+
|
|
23034
|
+
function createLayerFilterParam(resourceId, filter) {
|
|
23035
|
+
return {
|
|
23036
|
+
[`filter[${resourceId}]`]: propertiesFilterToExpressionString(filter)
|
|
23037
|
+
};
|
|
23038
|
+
}
|
|
23039
|
+
|
|
22956
23040
|
var __defProp$h = Object.defineProperty;
|
|
22957
23041
|
var __defProps$7 = Object.defineProperties;
|
|
22958
23042
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
@@ -22972,6 +23056,18 @@ var __spreadValues$9 = (a, b) => {
|
|
|
22972
23056
|
return a;
|
|
22973
23057
|
};
|
|
22974
23058
|
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
23059
|
+
var __objRest$1 = (source, exclude) => {
|
|
23060
|
+
var target = {};
|
|
23061
|
+
for (var prop in source)
|
|
23062
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
23063
|
+
target[prop] = source[prop];
|
|
23064
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
23065
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
23066
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
23067
|
+
target[prop] = source[prop];
|
|
23068
|
+
}
|
|
23069
|
+
return target;
|
|
23070
|
+
};
|
|
22975
23071
|
var __publicField$c = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22976
23072
|
var __async$b = (__this, __arguments, generator) => {
|
|
22977
23073
|
return new Promise((resolve, reject) => {
|
|
@@ -23036,8 +23132,18 @@ function createRasterAdapter(_0) {
|
|
|
23036
23132
|
baseUrl: connector.options.baseUrl || ""
|
|
23037
23133
|
});
|
|
23038
23134
|
if (opt) {
|
|
23039
|
-
const
|
|
23040
|
-
|
|
23135
|
+
const _a = layerOptions.adapterOptions || {}, { propertiesFilter } = _a, restAdapterOptions = __objRest$1(_a, ["propertiesFilter"]);
|
|
23136
|
+
const filterParams = createLayerFilterParam(
|
|
23137
|
+
resourceId,
|
|
23138
|
+
propertiesFilter
|
|
23139
|
+
);
|
|
23140
|
+
const layerAdapterOptions = __spreadProps$7(__spreadValues$9(__spreadValues$9({}, opt), restAdapterOptions), {
|
|
23141
|
+
params: __spreadValues$9({
|
|
23142
|
+
resource: resourceId
|
|
23143
|
+
}, filterParams),
|
|
23144
|
+
url: adapter === "TILE" && opt.url ? updateUrlParams(opt.url, __spreadValues$9({
|
|
23145
|
+
resource: String(resourceId)
|
|
23146
|
+
}, filterParams)) : opt.url,
|
|
23041
23147
|
layers: opt.layers || String(resourceId),
|
|
23042
23148
|
resourceId
|
|
23043
23149
|
});
|
|
@@ -23050,6 +23156,15 @@ function createRasterAdapter(_0) {
|
|
|
23050
23156
|
addLayer(addOptions) {
|
|
23051
23157
|
return super.addLayer(__spreadValues$9(__spreadValues$9({}, this.options), addOptions));
|
|
23052
23158
|
}
|
|
23159
|
+
propertiesFilter(filters) {
|
|
23160
|
+
return __async$b(this, null, function* () {
|
|
23161
|
+
var _a;
|
|
23162
|
+
const opt = this.options;
|
|
23163
|
+
const params = __spreadValues$9(__spreadValues$9({}, opt.params || {}), createLayerFilterParam(this.resourceId, filters));
|
|
23164
|
+
opt.params = params;
|
|
23165
|
+
(_a = this.updateLayer) == null ? void 0 : _a.call(this, { params });
|
|
23166
|
+
});
|
|
23167
|
+
}
|
|
23053
23168
|
getIdentificationIds() {
|
|
23054
23169
|
return __async$b(this, null, function* () {
|
|
23055
23170
|
if (this.item) {
|
|
@@ -23545,7 +23660,8 @@ function getCompanyLogo(connector, options) {
|
|
|
23545
23660
|
component: "pyramid"
|
|
23546
23661
|
}
|
|
23547
23662
|
});
|
|
23548
|
-
|
|
23663
|
+
const company_logo = settings && "company_logo" in settings ? settings.company_logo : void 0;
|
|
23664
|
+
if (company_logo && company_logo.enabled) {
|
|
23549
23665
|
const anchor = document.createElement("a");
|
|
23550
23666
|
anchor.style.position = "absolute";
|
|
23551
23667
|
anchor.style.bottom = "0";
|
|
@@ -23580,10 +23696,10 @@ function getCompanyLogo(connector, options) {
|
|
|
23580
23696
|
} else {
|
|
23581
23697
|
return;
|
|
23582
23698
|
}
|
|
23583
|
-
if (
|
|
23584
|
-
anchor.href =
|
|
23699
|
+
if (company_logo.link !== null && company_logo.link.trim() !== "") {
|
|
23700
|
+
anchor.href = company_logo.link;
|
|
23585
23701
|
anchor.target = "_blank";
|
|
23586
|
-
if (
|
|
23702
|
+
if (company_logo.link.search(/:\/\/nextgis/) !== -1) {
|
|
23587
23703
|
img.alt = "Get your own Web GIS at nextgis.com";
|
|
23588
23704
|
}
|
|
23589
23705
|
}
|
|
@@ -26120,7 +26236,7 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
26120
26236
|
addNgwLayer(options) {
|
|
26121
26237
|
return __async$1(this, null, function* () {
|
|
26122
26238
|
yield this.onMapLoad();
|
|
26123
|
-
const { keyname, resourceId } = options;
|
|
26239
|
+
const { keyname, resourceId, filters } = options;
|
|
26124
26240
|
if (keyname || resourceId !== void 0) {
|
|
26125
26241
|
deprecatedWarn(
|
|
26126
26242
|
"set `resource` options instead of `keyname` or `resourceId`"
|
|
@@ -26134,12 +26250,15 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
26134
26250
|
}
|
|
26135
26251
|
if (defined(this.options.baseUrl)) {
|
|
26136
26252
|
try {
|
|
26253
|
+
options.adapterOptions = options.adapterOptions || {};
|
|
26137
26254
|
if (defined(this.options.setViewDelay)) {
|
|
26138
|
-
options.adapterOptions = options.adapterOptions || {};
|
|
26139
26255
|
if (!defined(options.adapterOptions.setViewDelay)) {
|
|
26140
26256
|
options.adapterOptions.setViewDelay = this.options.setViewDelay;
|
|
26141
26257
|
}
|
|
26142
26258
|
}
|
|
26259
|
+
if (defined(filters)) {
|
|
26260
|
+
options.adapterOptions.propertiesFilter = filters;
|
|
26261
|
+
}
|
|
26143
26262
|
const adapter = createNgwLayerAdapter(options, this, this.connector);
|
|
26144
26263
|
const adapterOpts = __spreadValues$1(__spreadValues$1({
|
|
26145
26264
|
visibility: true
|
|
@@ -26231,7 +26350,6 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
26231
26350
|
const promise = fetchIdentifyGeoJson({
|
|
26232
26351
|
identify,
|
|
26233
26352
|
connector: this.connector,
|
|
26234
|
-
multiple,
|
|
26235
26353
|
requestOptions: { signal: abortController.signal }
|
|
26236
26354
|
});
|
|
26237
26355
|
if (promise && "then" in promise) {
|