@nextgis/ngw-leaflet 2.4.0 → 3.0.0-alpha.0
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 +955 -1055
- package/lib/ngw-leaflet.esm-browser.js.map +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.js +2 -2
- package/lib/ngw-leaflet.esm-bundler.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.prod.js +1 -1
- package/lib/ngw-leaflet.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-leaflet.global.js +955 -1055
- package/lib/ngw-leaflet.global.js.map +1 -1
- package/lib/ngw-leaflet.global.prod.js +1 -1
- package/lib/ngw-leaflet.global.prod.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-leaflet; version:
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.0; author: NextGIS */
|
|
2
2
|
function styleInject(css, ref) {
|
|
3
3
|
if ( ref === void 0 ) ref = {};
|
|
4
4
|
var insertAt = ref.insertAt;
|
|
@@ -14930,7 +14930,7 @@ function objectRemoveEmpty(obj) {
|
|
|
14930
14930
|
}
|
|
14931
14931
|
|
|
14932
14932
|
function round(val, toFixed) {
|
|
14933
|
-
const n =
|
|
14933
|
+
const n = 1;
|
|
14934
14934
|
return Math.round((val + Number.EPSILON) * n) / n;
|
|
14935
14935
|
}
|
|
14936
14936
|
|
|
@@ -15048,15 +15048,15 @@ function createFeaturePositionOptions(features) {
|
|
|
15048
15048
|
};
|
|
15049
15049
|
}
|
|
15050
15050
|
|
|
15051
|
-
var __defProp
|
|
15052
|
-
var __defNormalProp
|
|
15053
|
-
var __publicField$
|
|
15051
|
+
var __defProp$Y = Object.defineProperty;
|
|
15052
|
+
var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15053
|
+
var __publicField$E = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15054
15054
|
class BaseAdapter {
|
|
15055
15055
|
constructor(map, options) {
|
|
15056
15056
|
this.map = map;
|
|
15057
15057
|
this.options = options;
|
|
15058
|
-
__publicField$
|
|
15059
|
-
__publicField$
|
|
15058
|
+
__publicField$E(this, "layer");
|
|
15059
|
+
__publicField$E(this, "pane", "order-0");
|
|
15060
15060
|
if (options.order !== void 0) {
|
|
15061
15061
|
const pane = "order-" + options.order;
|
|
15062
15062
|
let exist = map.getPane(pane);
|
|
@@ -15085,19 +15085,19 @@ function convertMapClickEvent(evt) {
|
|
|
15085
15085
|
};
|
|
15086
15086
|
}
|
|
15087
15087
|
|
|
15088
|
-
var __defProp$
|
|
15089
|
-
var __getOwnPropSymbols$
|
|
15090
|
-
var __hasOwnProp$
|
|
15091
|
-
var __propIsEnum$
|
|
15092
|
-
var __defNormalProp$
|
|
15093
|
-
var __spreadValues$
|
|
15088
|
+
var __defProp$X = Object.defineProperty;
|
|
15089
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
|
15090
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
|
15091
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
|
15092
|
+
var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15093
|
+
var __spreadValues$F = (a, b) => {
|
|
15094
15094
|
for (var prop in b || (b = {}))
|
|
15095
|
-
if (__hasOwnProp$
|
|
15096
|
-
__defNormalProp$
|
|
15097
|
-
if (__getOwnPropSymbols$
|
|
15098
|
-
for (var prop of __getOwnPropSymbols$
|
|
15099
|
-
if (__propIsEnum$
|
|
15100
|
-
__defNormalProp$
|
|
15095
|
+
if (__hasOwnProp$G.call(b, prop))
|
|
15096
|
+
__defNormalProp$X(a, prop, b[prop]);
|
|
15097
|
+
if (__getOwnPropSymbols$G)
|
|
15098
|
+
for (var prop of __getOwnPropSymbols$G(b)) {
|
|
15099
|
+
if (__propIsEnum$G.call(b, prop))
|
|
15100
|
+
__defNormalProp$X(a, prop, b[prop]);
|
|
15101
15101
|
}
|
|
15102
15102
|
return a;
|
|
15103
15103
|
};
|
|
@@ -15107,7 +15107,7 @@ function createMouseEvent({
|
|
|
15107
15107
|
}) {
|
|
15108
15108
|
const layer_ = source.target;
|
|
15109
15109
|
const feature = layer_.feature;
|
|
15110
|
-
const opt = __spreadValues$
|
|
15110
|
+
const opt = __spreadValues$F({
|
|
15111
15111
|
layer,
|
|
15112
15112
|
feature,
|
|
15113
15113
|
event: convertMapClickEvent(source),
|
|
@@ -15116,30 +15116,30 @@ function createMouseEvent({
|
|
|
15116
15116
|
return opt;
|
|
15117
15117
|
}
|
|
15118
15118
|
|
|
15119
|
-
var __defProp$
|
|
15120
|
-
var __getOwnPropSymbols$
|
|
15121
|
-
var __hasOwnProp$
|
|
15122
|
-
var __propIsEnum$
|
|
15123
|
-
var __defNormalProp$
|
|
15124
|
-
var __spreadValues$
|
|
15119
|
+
var __defProp$W = Object.defineProperty;
|
|
15120
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
15121
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
15122
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
15123
|
+
var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15124
|
+
var __spreadValues$E = (a, b) => {
|
|
15125
15125
|
for (var prop in b || (b = {}))
|
|
15126
|
-
if (__hasOwnProp$
|
|
15127
|
-
__defNormalProp$
|
|
15128
|
-
if (__getOwnPropSymbols$
|
|
15129
|
-
for (var prop of __getOwnPropSymbols$
|
|
15130
|
-
if (__propIsEnum$
|
|
15131
|
-
__defNormalProp$
|
|
15126
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
15127
|
+
__defNormalProp$W(a, prop, b[prop]);
|
|
15128
|
+
if (__getOwnPropSymbols$F)
|
|
15129
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
15130
|
+
if (__propIsEnum$F.call(b, prop))
|
|
15131
|
+
__defNormalProp$W(a, prop, b[prop]);
|
|
15132
15132
|
}
|
|
15133
15133
|
return a;
|
|
15134
15134
|
};
|
|
15135
|
-
var __publicField$
|
|
15135
|
+
var __publicField$D = (obj, key, value) => __defNormalProp$W(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15136
15136
|
class GeoJsonEvents {
|
|
15137
15137
|
constructor(layer) {
|
|
15138
|
-
__publicField$
|
|
15139
|
-
__publicField$
|
|
15140
|
-
__publicField$
|
|
15141
|
-
__publicField$
|
|
15142
|
-
__publicField$
|
|
15138
|
+
__publicField$D(this, "layer");
|
|
15139
|
+
__publicField$D(this, "_onclick");
|
|
15140
|
+
__publicField$D(this, "_ondblclick");
|
|
15141
|
+
__publicField$D(this, "_mouseout");
|
|
15142
|
+
__publicField$D(this, "_mouseover");
|
|
15143
15143
|
this.layer = layer;
|
|
15144
15144
|
}
|
|
15145
15145
|
handleMouseEvents(layer) {
|
|
@@ -15148,7 +15148,7 @@ class GeoJsonEvents {
|
|
|
15148
15148
|
if (onClick_) {
|
|
15149
15149
|
this._onclick = (e) => {
|
|
15150
15150
|
const selected = !!this.layer._getSelected(layer);
|
|
15151
|
-
onClick_(__spreadValues$
|
|
15151
|
+
onClick_(__spreadValues$E({
|
|
15152
15152
|
selected
|
|
15153
15153
|
}, this._createMouseEvent(e)));
|
|
15154
15154
|
};
|
|
@@ -15158,7 +15158,7 @@ class GeoJsonEvents {
|
|
|
15158
15158
|
this._ondblclick = (e) => {
|
|
15159
15159
|
leafletSrcExports.DomEvent.stopPropagation(e);
|
|
15160
15160
|
const selected = !!this.layer._getSelected(layer);
|
|
15161
|
-
onDoubleClick(__spreadValues$
|
|
15161
|
+
onDoubleClick(__spreadValues$E({
|
|
15162
15162
|
selected
|
|
15163
15163
|
}, this._createMouseEvent(e)));
|
|
15164
15164
|
};
|
|
@@ -15836,19 +15836,19 @@ const typeExpressions = {
|
|
|
15836
15836
|
typeof: evaluateArgs(([arg]) => typeOfValue(arg))
|
|
15837
15837
|
};
|
|
15838
15838
|
|
|
15839
|
-
var __defProp$
|
|
15840
|
-
var __getOwnPropSymbols$
|
|
15841
|
-
var __hasOwnProp$
|
|
15842
|
-
var __propIsEnum$
|
|
15843
|
-
var __defNormalProp$
|
|
15844
|
-
var __spreadValues$
|
|
15839
|
+
var __defProp$V = Object.defineProperty;
|
|
15840
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
15841
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
15842
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
15843
|
+
var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15844
|
+
var __spreadValues$D = (a, b) => {
|
|
15845
15845
|
for (var prop in b || (b = {}))
|
|
15846
|
-
if (__hasOwnProp$
|
|
15847
|
-
__defNormalProp$
|
|
15848
|
-
if (__getOwnPropSymbols$
|
|
15849
|
-
for (var prop of __getOwnPropSymbols$
|
|
15850
|
-
if (__propIsEnum$
|
|
15851
|
-
__defNormalProp$
|
|
15846
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
15847
|
+
__defNormalProp$V(a, prop, b[prop]);
|
|
15848
|
+
if (__getOwnPropSymbols$E)
|
|
15849
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
15850
|
+
if (__propIsEnum$E.call(b, prop))
|
|
15851
|
+
__defNormalProp$V(a, prop, b[prop]);
|
|
15852
15852
|
}
|
|
15853
15853
|
return a;
|
|
15854
15854
|
};
|
|
@@ -15860,7 +15860,7 @@ function isExpression(value) {
|
|
|
15860
15860
|
}
|
|
15861
15861
|
return false;
|
|
15862
15862
|
}
|
|
15863
|
-
const expressions = __spreadValues$
|
|
15863
|
+
const expressions = __spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
|
|
15864
15864
|
function evaluate(expression, data = {}) {
|
|
15865
15865
|
const [name, ...args] = expression;
|
|
15866
15866
|
const expressionFun = expressions[name];
|
|
@@ -15873,19 +15873,19 @@ function evaluate(expression, data = {}) {
|
|
|
15873
15873
|
throw new Error(`Expression "${name}" is not supported.`);
|
|
15874
15874
|
}
|
|
15875
15875
|
|
|
15876
|
-
var __defProp$
|
|
15877
|
-
var __getOwnPropSymbols$
|
|
15878
|
-
var __hasOwnProp$
|
|
15879
|
-
var __propIsEnum$
|
|
15880
|
-
var __defNormalProp$
|
|
15881
|
-
var __spreadValues$
|
|
15876
|
+
var __defProp$U = Object.defineProperty;
|
|
15877
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
15878
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
15879
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
15880
|
+
var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15881
|
+
var __spreadValues$C = (a, b) => {
|
|
15882
15882
|
for (var prop in b || (b = {}))
|
|
15883
|
-
if (__hasOwnProp$
|
|
15884
|
-
__defNormalProp$
|
|
15885
|
-
if (__getOwnPropSymbols$
|
|
15886
|
-
for (var prop of __getOwnPropSymbols$
|
|
15887
|
-
if (__propIsEnum$
|
|
15888
|
-
__defNormalProp$
|
|
15883
|
+
if (__hasOwnProp$D.call(b, prop))
|
|
15884
|
+
__defNormalProp$U(a, prop, b[prop]);
|
|
15885
|
+
if (__getOwnPropSymbols$D)
|
|
15886
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
|
15887
|
+
if (__propIsEnum$D.call(b, prop))
|
|
15888
|
+
__defNormalProp$U(a, prop, b[prop]);
|
|
15889
15889
|
}
|
|
15890
15890
|
return a;
|
|
15891
15891
|
};
|
|
@@ -15918,25 +15918,25 @@ function createExpressionCallback(paint) {
|
|
|
15918
15918
|
for (const p in expressions) {
|
|
15919
15919
|
fromCb[p] = expressions[p](feature);
|
|
15920
15920
|
}
|
|
15921
|
-
return __spreadValues$
|
|
15921
|
+
return __spreadValues$C(__spreadValues$C({}, paint), fromCb);
|
|
15922
15922
|
};
|
|
15923
15923
|
}
|
|
15924
15924
|
return;
|
|
15925
15925
|
}
|
|
15926
15926
|
|
|
15927
|
-
var __defProp$
|
|
15928
|
-
var __getOwnPropSymbols$
|
|
15929
|
-
var __hasOwnProp$
|
|
15930
|
-
var __propIsEnum$
|
|
15931
|
-
var __defNormalProp$
|
|
15932
|
-
var __spreadValues$
|
|
15927
|
+
var __defProp$T = Object.defineProperty;
|
|
15928
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
15929
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
15930
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
15931
|
+
var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15932
|
+
var __spreadValues$B = (a, b) => {
|
|
15933
15933
|
for (var prop in b || (b = {}))
|
|
15934
|
-
if (__hasOwnProp$
|
|
15935
|
-
__defNormalProp$
|
|
15936
|
-
if (__getOwnPropSymbols$
|
|
15937
|
-
for (var prop of __getOwnPropSymbols$
|
|
15938
|
-
if (__propIsEnum$
|
|
15939
|
-
__defNormalProp$
|
|
15934
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
15935
|
+
__defNormalProp$T(a, prop, b[prop]);
|
|
15936
|
+
if (__getOwnPropSymbols$C)
|
|
15937
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
15938
|
+
if (__propIsEnum$C.call(b, prop))
|
|
15939
|
+
__defNormalProp$T(a, prop, b[prop]);
|
|
15940
15940
|
}
|
|
15941
15941
|
return a;
|
|
15942
15942
|
};
|
|
@@ -15983,7 +15983,7 @@ function isPropertyFilter(filter) {
|
|
|
15983
15983
|
return false;
|
|
15984
15984
|
}
|
|
15985
15985
|
function featureFilter(feature, filters) {
|
|
15986
|
-
const properties = __spreadValues$
|
|
15986
|
+
const properties = __spreadValues$B({}, feature.properties);
|
|
15987
15987
|
if (properties) {
|
|
15988
15988
|
properties.$id = feature.id;
|
|
15989
15989
|
return propertiesFilter(properties, filters);
|
|
@@ -16018,19 +16018,19 @@ function propertiesFilter(properties, filters) {
|
|
|
16018
16018
|
return logic === "any" ? filters_.some(filterFunction) : filters_.every(filterFunction);
|
|
16019
16019
|
}
|
|
16020
16020
|
|
|
16021
|
-
var __defProp$
|
|
16022
|
-
var __getOwnPropSymbols$
|
|
16023
|
-
var __hasOwnProp$
|
|
16024
|
-
var __propIsEnum$
|
|
16025
|
-
var __defNormalProp$
|
|
16026
|
-
var __spreadValues$
|
|
16021
|
+
var __defProp$S = Object.defineProperty;
|
|
16022
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
16023
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
16024
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
16025
|
+
var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16026
|
+
var __spreadValues$A = (a, b) => {
|
|
16027
16027
|
for (var prop in b || (b = {}))
|
|
16028
|
-
if (__hasOwnProp$
|
|
16029
|
-
__defNormalProp$
|
|
16030
|
-
if (__getOwnPropSymbols$
|
|
16031
|
-
for (var prop of __getOwnPropSymbols$
|
|
16032
|
-
if (__propIsEnum$
|
|
16033
|
-
__defNormalProp$
|
|
16028
|
+
if (__hasOwnProp$B.call(b, prop))
|
|
16029
|
+
__defNormalProp$S(a, prop, b[prop]);
|
|
16030
|
+
if (__getOwnPropSymbols$B)
|
|
16031
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
|
16032
|
+
if (__propIsEnum$B.call(b, prop))
|
|
16033
|
+
__defNormalProp$S(a, prop, b[prop]);
|
|
16034
16034
|
}
|
|
16035
16035
|
return a;
|
|
16036
16036
|
};
|
|
@@ -16059,7 +16059,7 @@ function createPropertiesPaint(propertiesPaint) {
|
|
|
16059
16059
|
return (feature) => {
|
|
16060
16060
|
const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
|
|
16061
16061
|
if (paint) {
|
|
16062
|
-
return __spreadValues$
|
|
16062
|
+
return __spreadValues$A(__spreadValues$A({}, mask), paint[1]);
|
|
16063
16063
|
}
|
|
16064
16064
|
return mask;
|
|
16065
16065
|
};
|
|
@@ -16083,8 +16083,8 @@ function expressionCallback({
|
|
|
16083
16083
|
}
|
|
16084
16084
|
function finalizePaint({ paint, defaultPaint }) {
|
|
16085
16085
|
var _a;
|
|
16086
|
-
let newPaint = __spreadValues$
|
|
16087
|
-
newPaint = __spreadValues$
|
|
16086
|
+
let newPaint = __spreadValues$A({}, defaultPaint);
|
|
16087
|
+
newPaint = __spreadValues$A(__spreadValues$A({}, newPaint), paint);
|
|
16088
16088
|
newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
|
|
16089
16089
|
newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
|
|
16090
16090
|
return newPaint;
|
|
@@ -16097,7 +16097,7 @@ function preparePaint({
|
|
|
16097
16097
|
if (!paint) {
|
|
16098
16098
|
throw new Error("paint is empty");
|
|
16099
16099
|
}
|
|
16100
|
-
let newPaint = __spreadValues$
|
|
16100
|
+
let newPaint = __spreadValues$A({}, defaultPaint);
|
|
16101
16101
|
if (isPaintCallback(paint)) {
|
|
16102
16102
|
const getPaintFunction = (feature) => {
|
|
16103
16103
|
const getPaint = preparePaint({
|
|
@@ -16154,41 +16154,41 @@ function preparePaint({
|
|
|
16154
16154
|
return newPaint;
|
|
16155
16155
|
}
|
|
16156
16156
|
|
|
16157
|
-
var __defProp$
|
|
16157
|
+
var __defProp$R = Object.defineProperty;
|
|
16158
16158
|
var __defProps$j = Object.defineProperties;
|
|
16159
16159
|
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
16160
|
-
var __getOwnPropSymbols$
|
|
16161
|
-
var __hasOwnProp$
|
|
16162
|
-
var __propIsEnum$
|
|
16163
|
-
var __defNormalProp$
|
|
16164
|
-
var __spreadValues$
|
|
16160
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
16161
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
16162
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
16163
|
+
var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16164
|
+
var __spreadValues$z = (a, b) => {
|
|
16165
16165
|
for (var prop in b || (b = {}))
|
|
16166
|
-
if (__hasOwnProp$
|
|
16167
|
-
__defNormalProp$
|
|
16168
|
-
if (__getOwnPropSymbols$
|
|
16169
|
-
for (var prop of __getOwnPropSymbols$
|
|
16170
|
-
if (__propIsEnum$
|
|
16171
|
-
__defNormalProp$
|
|
16166
|
+
if (__hasOwnProp$A.call(b, prop))
|
|
16167
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
16168
|
+
if (__getOwnPropSymbols$A)
|
|
16169
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
|
16170
|
+
if (__propIsEnum$A.call(b, prop))
|
|
16171
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
16172
16172
|
}
|
|
16173
16173
|
return a;
|
|
16174
16174
|
};
|
|
16175
16175
|
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
16176
|
-
var __objRest$
|
|
16176
|
+
var __objRest$5 = (source, exclude) => {
|
|
16177
16177
|
var target = {};
|
|
16178
16178
|
for (var prop in source)
|
|
16179
|
-
if (__hasOwnProp$
|
|
16179
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
16180
16180
|
target[prop] = source[prop];
|
|
16181
|
-
if (source != null && __getOwnPropSymbols$
|
|
16182
|
-
for (var prop of __getOwnPropSymbols$
|
|
16183
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
16181
|
+
if (source != null && __getOwnPropSymbols$A)
|
|
16182
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
|
16183
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
|
16184
16184
|
target[prop] = source[prop];
|
|
16185
16185
|
}
|
|
16186
16186
|
return target;
|
|
16187
16187
|
};
|
|
16188
|
-
var __publicField$
|
|
16188
|
+
var __publicField$C = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
|
|
16189
16189
|
class GeoJsonPaint {
|
|
16190
16190
|
constructor(layer) {
|
|
16191
|
-
__publicField$
|
|
16191
|
+
__publicField$C(this, "layer");
|
|
16192
16192
|
this.layer = layer;
|
|
16193
16193
|
}
|
|
16194
16194
|
setPaintEachLayer(paint) {
|
|
@@ -16256,7 +16256,7 @@ class GeoJsonPaint {
|
|
|
16256
16256
|
return PAINT;
|
|
16257
16257
|
}
|
|
16258
16258
|
_createDivIcon(icon) {
|
|
16259
|
-
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$
|
|
16259
|
+
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$5(_a, ["html", "rotate", "className"]);
|
|
16260
16260
|
const element = document.createElement("div");
|
|
16261
16261
|
if (className) {
|
|
16262
16262
|
element.className = className;
|
|
@@ -16267,7 +16267,7 @@ class GeoJsonPaint {
|
|
|
16267
16267
|
if (html) {
|
|
16268
16268
|
element.innerHTML = html;
|
|
16269
16269
|
}
|
|
16270
|
-
const divIcon = new leafletSrcExports.DivIcon(__spreadProps$j(__spreadValues$
|
|
16270
|
+
const divIcon = new leafletSrcExports.DivIcon(__spreadProps$j(__spreadValues$z({
|
|
16271
16271
|
className: ""
|
|
16272
16272
|
}, toLIconOpt), {
|
|
16273
16273
|
html: element
|
|
@@ -16293,7 +16293,7 @@ class GeoJsonPaint {
|
|
|
16293
16293
|
}
|
|
16294
16294
|
return (_, latlng) => {
|
|
16295
16295
|
const p = PAINT;
|
|
16296
|
-
return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$
|
|
16296
|
+
return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$z(__spreadValues$z({}, p), icon)));
|
|
16297
16297
|
};
|
|
16298
16298
|
}
|
|
16299
16299
|
createPaintOptions(paint) {
|
|
@@ -16315,27 +16315,27 @@ class GeoJsonPaint {
|
|
|
16315
16315
|
}
|
|
16316
16316
|
}
|
|
16317
16317
|
|
|
16318
|
-
var __defProp$
|
|
16318
|
+
var __defProp$Q = Object.defineProperty;
|
|
16319
16319
|
var __defProps$i = Object.defineProperties;
|
|
16320
16320
|
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
16321
|
-
var __getOwnPropSymbols$
|
|
16322
|
-
var __hasOwnProp$
|
|
16323
|
-
var __propIsEnum$
|
|
16324
|
-
var __defNormalProp$
|
|
16325
|
-
var __spreadValues$
|
|
16321
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
16322
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
16323
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
16324
|
+
var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16325
|
+
var __spreadValues$y = (a, b) => {
|
|
16326
16326
|
for (var prop in b || (b = {}))
|
|
16327
|
-
if (__hasOwnProp$
|
|
16328
|
-
__defNormalProp$
|
|
16329
|
-
if (__getOwnPropSymbols$
|
|
16330
|
-
for (var prop of __getOwnPropSymbols$
|
|
16331
|
-
if (__propIsEnum$
|
|
16332
|
-
__defNormalProp$
|
|
16327
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
16328
|
+
__defNormalProp$Q(a, prop, b[prop]);
|
|
16329
|
+
if (__getOwnPropSymbols$z)
|
|
16330
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
16331
|
+
if (__propIsEnum$z.call(b, prop))
|
|
16332
|
+
__defNormalProp$Q(a, prop, b[prop]);
|
|
16333
16333
|
}
|
|
16334
16334
|
return a;
|
|
16335
16335
|
};
|
|
16336
16336
|
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
16337
|
-
var __publicField$
|
|
16338
|
-
var __async$
|
|
16337
|
+
var __publicField$B = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
16338
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
16339
16339
|
return new Promise((resolve, reject) => {
|
|
16340
16340
|
var fulfilled = (value) => {
|
|
16341
16341
|
try {
|
|
@@ -16358,22 +16358,22 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
16358
16358
|
class GeoJsonAdapter extends BaseAdapter {
|
|
16359
16359
|
constructor(map, options) {
|
|
16360
16360
|
super(map, options);
|
|
16361
|
-
__publicField$
|
|
16362
|
-
__publicField$
|
|
16363
|
-
__publicField$
|
|
16364
|
-
__publicField$
|
|
16365
|
-
__publicField$
|
|
16366
|
-
__publicField$
|
|
16367
|
-
__publicField$
|
|
16368
|
-
__publicField$
|
|
16369
|
-
__publicField$
|
|
16370
|
-
__publicField$
|
|
16371
|
-
__publicField$
|
|
16372
|
-
__publicField$
|
|
16373
|
-
__publicField$
|
|
16361
|
+
__publicField$B(this, "layer");
|
|
16362
|
+
__publicField$B(this, "selected", false);
|
|
16363
|
+
__publicField$B(this, "type");
|
|
16364
|
+
__publicField$B(this, "_layers", []);
|
|
16365
|
+
__publicField$B(this, "_events");
|
|
16366
|
+
__publicField$B(this, "paint");
|
|
16367
|
+
__publicField$B(this, "selectedPaint");
|
|
16368
|
+
__publicField$B(this, "_selectedLayers", []);
|
|
16369
|
+
__publicField$B(this, "_filteredLayers", []);
|
|
16370
|
+
__publicField$B(this, "_filterFun");
|
|
16371
|
+
__publicField$B(this, "_openedPopup", []);
|
|
16372
|
+
__publicField$B(this, "_paint");
|
|
16373
|
+
__publicField$B(this, "$updateTooltip", debounce(() => {
|
|
16374
16374
|
this.updateTooltip();
|
|
16375
16375
|
}, 300));
|
|
16376
|
-
__publicField$
|
|
16376
|
+
__publicField$B(this, "$unselect", () => {
|
|
16377
16377
|
this.unselect();
|
|
16378
16378
|
});
|
|
16379
16379
|
this._events = new GeoJsonEvents(this);
|
|
@@ -16382,7 +16382,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16382
16382
|
addLayer(options) {
|
|
16383
16383
|
Object.assign(this.options, options);
|
|
16384
16384
|
this.paint = options.paint;
|
|
16385
|
-
this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$i(__spreadValues$
|
|
16385
|
+
this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$i(__spreadValues$y({}, options.nativeOptions), {
|
|
16386
16386
|
pane: this.pane
|
|
16387
16387
|
}));
|
|
16388
16388
|
this.selectedPaint = options.selectedPaint;
|
|
@@ -16431,7 +16431,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16431
16431
|
}
|
|
16432
16432
|
getSelected() {
|
|
16433
16433
|
return this._selectedLayers.map((x) => {
|
|
16434
|
-
return __spreadValues$
|
|
16434
|
+
return __spreadValues$y({
|
|
16435
16435
|
target: this,
|
|
16436
16436
|
feature: x.feature,
|
|
16437
16437
|
layer: x
|
|
@@ -16450,14 +16450,14 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16450
16450
|
const filteredLayers = [];
|
|
16451
16451
|
this._layers.forEach(({ feature, layer }) => {
|
|
16452
16452
|
if (layer) {
|
|
16453
|
-
const ok = fun ? fun(__spreadValues$
|
|
16453
|
+
const ok = fun ? fun(__spreadValues$y({
|
|
16454
16454
|
target: this,
|
|
16455
16455
|
feature,
|
|
16456
16456
|
layer
|
|
16457
16457
|
}, createFeaturePositionOptions(feature))) : true;
|
|
16458
16458
|
if (ok) {
|
|
16459
16459
|
layer_.addLayer(layer);
|
|
16460
|
-
filteredLayers.push(__spreadValues$
|
|
16460
|
+
filteredLayers.push(__spreadValues$y({
|
|
16461
16461
|
target: this,
|
|
16462
16462
|
feature,
|
|
16463
16463
|
layer
|
|
@@ -16478,7 +16478,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16478
16478
|
getLayers() {
|
|
16479
16479
|
return this._layers.map(({ layer, feature }) => {
|
|
16480
16480
|
const visible = layer && !!layer._map;
|
|
16481
|
-
return __spreadValues$
|
|
16481
|
+
return __spreadValues$y({
|
|
16482
16482
|
feature,
|
|
16483
16483
|
layer,
|
|
16484
16484
|
visible,
|
|
@@ -16596,13 +16596,13 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16596
16596
|
}
|
|
16597
16597
|
}
|
|
16598
16598
|
updatePaint(paint) {
|
|
16599
|
-
this.paint = __spreadValues$
|
|
16599
|
+
this.paint = __spreadValues$y(__spreadValues$y({}, this.paint), paint);
|
|
16600
16600
|
for (const l of this._layers) {
|
|
16601
16601
|
this._paint.setPaint(l, this.paint);
|
|
16602
16602
|
}
|
|
16603
16603
|
}
|
|
16604
16604
|
updateSelectedPaint(paint) {
|
|
16605
|
-
this.selectedPaint = __spreadValues$
|
|
16605
|
+
this.selectedPaint = __spreadValues$y(__spreadValues$y({}, this.selectedPaint), paint);
|
|
16606
16606
|
for (const l of this._selectedLayers) {
|
|
16607
16607
|
this._paint.setPaint(l, this.selectedPaint);
|
|
16608
16608
|
}
|
|
@@ -16619,7 +16619,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16619
16619
|
if (feature.properties && labelField) {
|
|
16620
16620
|
message = feature.properties[labelField];
|
|
16621
16621
|
} else if (label) {
|
|
16622
|
-
message = label(__spreadValues$
|
|
16622
|
+
message = label(__spreadValues$y(__spreadValues$y({
|
|
16623
16623
|
target: this
|
|
16624
16624
|
}, layerDef), createFeaturePositionOptions(feature)));
|
|
16625
16625
|
}
|
|
@@ -16630,7 +16630,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16630
16630
|
}
|
|
16631
16631
|
}
|
|
16632
16632
|
_openPopup(_0) {
|
|
16633
|
-
return __async$
|
|
16633
|
+
return __async$s(this, arguments, function* (def, options = {}, type, latLng) {
|
|
16634
16634
|
var _a, _b;
|
|
16635
16635
|
const { feature, layer } = def;
|
|
16636
16636
|
const {
|
|
@@ -16638,7 +16638,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16638
16638
|
autoPan,
|
|
16639
16639
|
maxWidth,
|
|
16640
16640
|
closeButton: closeButton_
|
|
16641
|
-
} = __spreadValues$
|
|
16641
|
+
} = __spreadValues$y({
|
|
16642
16642
|
minWidth: 300
|
|
16643
16643
|
}, options);
|
|
16644
16644
|
const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
|
|
@@ -16654,7 +16654,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16654
16654
|
};
|
|
16655
16655
|
let content;
|
|
16656
16656
|
if (options.createPopupContent) {
|
|
16657
|
-
content = yield options.createPopupContent(__spreadValues$
|
|
16657
|
+
content = yield options.createPopupContent(__spreadValues$y({
|
|
16658
16658
|
layer,
|
|
16659
16659
|
feature,
|
|
16660
16660
|
target: this,
|
|
@@ -16730,9 +16730,9 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16730
16730
|
lopt = {
|
|
16731
16731
|
style: (feature) => {
|
|
16732
16732
|
if (feature) {
|
|
16733
|
-
return this._paint.preparePaint(__spreadValues$
|
|
16733
|
+
return this._paint.preparePaint(__spreadValues$y(__spreadValues$y({}, PAINT), paint(feature)));
|
|
16734
16734
|
} else {
|
|
16735
|
-
return this._paint.preparePaint(__spreadProps$i(__spreadValues$
|
|
16735
|
+
return this._paint.preparePaint(__spreadProps$i(__spreadValues$y({}, PAINT), { type: "path" }));
|
|
16736
16736
|
}
|
|
16737
16737
|
}
|
|
16738
16738
|
};
|
|
@@ -16748,7 +16748,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16748
16748
|
_onEachFeature(feature, layer) {
|
|
16749
16749
|
const layer_ = this.layer;
|
|
16750
16750
|
if (layer_) {
|
|
16751
|
-
const def = __spreadValues$
|
|
16751
|
+
const def = __spreadValues$y({
|
|
16752
16752
|
target: this,
|
|
16753
16753
|
feature,
|
|
16754
16754
|
layer
|
|
@@ -16783,7 +16783,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16783
16783
|
setTimeout(() => {
|
|
16784
16784
|
if (popup) {
|
|
16785
16785
|
this._openPopup(
|
|
16786
|
-
__spreadValues$
|
|
16786
|
+
__spreadValues$y({
|
|
16787
16787
|
target: this,
|
|
16788
16788
|
layer,
|
|
16789
16789
|
feature
|
|
@@ -16801,7 +16801,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16801
16801
|
leafletSrcExports.DomEvent.stopPropagation(e);
|
|
16802
16802
|
const layer = e.target;
|
|
16803
16803
|
const feature = layer.feature;
|
|
16804
|
-
const def = __spreadValues$
|
|
16804
|
+
const def = __spreadValues$y({
|
|
16805
16805
|
target: this,
|
|
16806
16806
|
layer,
|
|
16807
16807
|
feature
|
|
@@ -16834,7 +16834,7 @@ class GeoJsonAdapter extends BaseAdapter {
|
|
|
16834
16834
|
}
|
|
16835
16835
|
if (this.options.onSelect) {
|
|
16836
16836
|
const features = def.feature ? [def.feature] : [];
|
|
16837
|
-
this.options.onSelect(__spreadValues$
|
|
16837
|
+
this.options.onSelect(__spreadValues$y({
|
|
16838
16838
|
type,
|
|
16839
16839
|
layer: this,
|
|
16840
16840
|
features
|
|
@@ -16919,20 +16919,20 @@ function callAjax(src, headers) {
|
|
|
16919
16919
|
return [promise, abortFunc];
|
|
16920
16920
|
}
|
|
16921
16921
|
|
|
16922
|
-
var __defProp$
|
|
16923
|
-
var __defNormalProp$
|
|
16924
|
-
var __publicField$
|
|
16922
|
+
var __defProp$P = Object.defineProperty;
|
|
16923
|
+
var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16924
|
+
var __publicField$A = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
16925
16925
|
class Queue {
|
|
16926
16926
|
/**
|
|
16927
16927
|
* @param {PromiseQueueOptions} options - Configuration options for the queue.
|
|
16928
16928
|
*/
|
|
16929
16929
|
constructor({ concurrency = 1, delay = 0 } = {}) {
|
|
16930
|
-
__publicField$
|
|
16931
|
-
__publicField$
|
|
16932
|
-
__publicField$
|
|
16933
|
-
__publicField$
|
|
16934
|
-
__publicField$
|
|
16935
|
-
__publicField$
|
|
16930
|
+
__publicField$A(this, "queue", []);
|
|
16931
|
+
__publicField$A(this, "concurrency");
|
|
16932
|
+
__publicField$A(this, "activeCount", 0);
|
|
16933
|
+
__publicField$A(this, "timeoutId");
|
|
16934
|
+
__publicField$A(this, "delay");
|
|
16935
|
+
__publicField$A(this, "toAbort", []);
|
|
16936
16936
|
this.concurrency = concurrency;
|
|
16937
16937
|
this.delay = delay;
|
|
16938
16938
|
}
|
|
@@ -17008,13 +17008,13 @@ class Queue {
|
|
|
17008
17008
|
|
|
17009
17009
|
const imageQueue = new Queue({ concurrency: 6, delay: 200 });
|
|
17010
17010
|
|
|
17011
|
-
var __defProp$
|
|
17012
|
-
var __defNormalProp$
|
|
17013
|
-
var __publicField$
|
|
17011
|
+
var __defProp$O = Object.defineProperty;
|
|
17012
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17013
|
+
var __publicField$z = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
|
|
17014
17014
|
class ImageOverlay extends leafletSrcExports.ImageOverlay {
|
|
17015
17015
|
constructor(imageUrl, bounds, options) {
|
|
17016
17016
|
super(imageUrl, bounds, options);
|
|
17017
|
-
__publicField$
|
|
17017
|
+
__publicField$z(this, "_aborter");
|
|
17018
17018
|
}
|
|
17019
17019
|
cancelLoad() {
|
|
17020
17020
|
if (this._aborter) {
|
|
@@ -17039,13 +17039,13 @@ class ImageOverlay extends leafletSrcExports.ImageOverlay {
|
|
|
17039
17039
|
}
|
|
17040
17040
|
}
|
|
17041
17041
|
|
|
17042
|
-
var __defProp$
|
|
17043
|
-
var __defNormalProp$
|
|
17044
|
-
var __publicField$
|
|
17042
|
+
var __defProp$N = Object.defineProperty;
|
|
17043
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17044
|
+
var __publicField$y = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17045
17045
|
class ImageLayer extends leafletSrcExports.Layer {
|
|
17046
17046
|
constructor(url, options) {
|
|
17047
17047
|
super(options);
|
|
17048
|
-
__publicField$
|
|
17048
|
+
__publicField$y(this, "defaultWmsParams", {
|
|
17049
17049
|
service: "WMS",
|
|
17050
17050
|
request: "GetMap",
|
|
17051
17051
|
version: "1.1.1",
|
|
@@ -17054,7 +17054,7 @@ class ImageLayer extends leafletSrcExports.Layer {
|
|
|
17054
17054
|
format: "image/jpeg",
|
|
17055
17055
|
transparent: false
|
|
17056
17056
|
});
|
|
17057
|
-
__publicField$
|
|
17057
|
+
__publicField$y(this, "options", {
|
|
17058
17058
|
crs: null,
|
|
17059
17059
|
uppercase: false,
|
|
17060
17060
|
attribution: "",
|
|
@@ -17066,11 +17066,11 @@ class ImageLayer extends leafletSrcExports.Layer {
|
|
|
17066
17066
|
viewPortBuffer: 0,
|
|
17067
17067
|
setViewDelay: 100
|
|
17068
17068
|
});
|
|
17069
|
-
__publicField$
|
|
17070
|
-
__publicField$
|
|
17071
|
-
__publicField$
|
|
17072
|
-
__publicField$
|
|
17073
|
-
__publicField$
|
|
17069
|
+
__publicField$y(this, "wmsParams");
|
|
17070
|
+
__publicField$y(this, "_url");
|
|
17071
|
+
__publicField$y(this, "_currentUrl");
|
|
17072
|
+
__publicField$y(this, "_currentOverlay");
|
|
17073
|
+
__publicField$y(this, "_loadedOverlay");
|
|
17074
17074
|
this._url = url;
|
|
17075
17075
|
const params = {};
|
|
17076
17076
|
const opts = {};
|
|
@@ -17229,34 +17229,34 @@ class ImageLayer extends leafletSrcExports.Layer {
|
|
|
17229
17229
|
}
|
|
17230
17230
|
}
|
|
17231
17231
|
|
|
17232
|
-
var __defProp$
|
|
17233
|
-
var __getOwnPropSymbols$
|
|
17234
|
-
var __hasOwnProp$
|
|
17235
|
-
var __propIsEnum$
|
|
17236
|
-
var __defNormalProp$
|
|
17237
|
-
var __spreadValues$
|
|
17232
|
+
var __defProp$M = Object.defineProperty;
|
|
17233
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
17234
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
17235
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
17236
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17237
|
+
var __spreadValues$x = (a, b) => {
|
|
17238
17238
|
for (var prop in b || (b = {}))
|
|
17239
|
-
if (__hasOwnProp$
|
|
17240
|
-
__defNormalProp$
|
|
17241
|
-
if (__getOwnPropSymbols$
|
|
17242
|
-
for (var prop of __getOwnPropSymbols$
|
|
17243
|
-
if (__propIsEnum$
|
|
17244
|
-
__defNormalProp$
|
|
17239
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
17240
|
+
__defNormalProp$M(a, prop, b[prop]);
|
|
17241
|
+
if (__getOwnPropSymbols$y)
|
|
17242
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
17243
|
+
if (__propIsEnum$y.call(b, prop))
|
|
17244
|
+
__defNormalProp$M(a, prop, b[prop]);
|
|
17245
17245
|
}
|
|
17246
17246
|
return a;
|
|
17247
17247
|
};
|
|
17248
|
-
var __publicField$
|
|
17248
|
+
var __publicField$x = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17249
17249
|
class ImageAdapter extends BaseAdapter {
|
|
17250
17250
|
constructor() {
|
|
17251
17251
|
super(...arguments);
|
|
17252
|
-
__publicField$
|
|
17252
|
+
__publicField$x(this, "layer");
|
|
17253
17253
|
}
|
|
17254
17254
|
addLayer(options) {
|
|
17255
17255
|
const url = options && options.url;
|
|
17256
17256
|
if (url) {
|
|
17257
|
-
options = __spreadValues$
|
|
17257
|
+
options = __spreadValues$x({ transparent: true }, options);
|
|
17258
17258
|
const updateWmsParamsFromOpt = options.updateWmsParams;
|
|
17259
|
-
this.layer = new ImageLayer(url, __spreadValues$
|
|
17259
|
+
this.layer = new ImageLayer(url, __spreadValues$x(__spreadValues$x(__spreadValues$x({
|
|
17260
17260
|
pane: this.pane,
|
|
17261
17261
|
headers: options.headers,
|
|
17262
17262
|
setViewDelay: options.setViewDelay
|
|
@@ -17272,7 +17272,7 @@ class ImageAdapter extends BaseAdapter {
|
|
|
17272
17272
|
}
|
|
17273
17273
|
}
|
|
17274
17274
|
}
|
|
17275
|
-
__publicField$
|
|
17275
|
+
__publicField$x(ImageAdapter, "queue", imageQueue);
|
|
17276
17276
|
|
|
17277
17277
|
function makeRemote(Base) {
|
|
17278
17278
|
return class RemoteTileLayer extends Base {
|
|
@@ -17334,33 +17334,33 @@ class TileLayerBase extends leafletSrcExports.TileLayer {
|
|
|
17334
17334
|
}
|
|
17335
17335
|
const TileLayer = makeRemote(TileLayerBase);
|
|
17336
17336
|
|
|
17337
|
-
var __defProp$
|
|
17337
|
+
var __defProp$L = Object.defineProperty;
|
|
17338
17338
|
var __defProps$h = Object.defineProperties;
|
|
17339
17339
|
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
17340
|
-
var __getOwnPropSymbols$
|
|
17341
|
-
var __hasOwnProp$
|
|
17342
|
-
var __propIsEnum$
|
|
17343
|
-
var __defNormalProp$
|
|
17344
|
-
var __spreadValues$
|
|
17340
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
17341
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
17342
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
17343
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17344
|
+
var __spreadValues$w = (a, b) => {
|
|
17345
17345
|
for (var prop in b || (b = {}))
|
|
17346
|
-
if (__hasOwnProp$
|
|
17347
|
-
__defNormalProp$
|
|
17348
|
-
if (__getOwnPropSymbols$
|
|
17349
|
-
for (var prop of __getOwnPropSymbols$
|
|
17350
|
-
if (__propIsEnum$
|
|
17351
|
-
__defNormalProp$
|
|
17346
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
17347
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
17348
|
+
if (__getOwnPropSymbols$x)
|
|
17349
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
17350
|
+
if (__propIsEnum$x.call(b, prop))
|
|
17351
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
17352
17352
|
}
|
|
17353
17353
|
return a;
|
|
17354
17354
|
};
|
|
17355
17355
|
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
17356
|
-
var __objRest$
|
|
17356
|
+
var __objRest$4 = (source, exclude) => {
|
|
17357
17357
|
var target = {};
|
|
17358
17358
|
for (var prop in source)
|
|
17359
|
-
if (__hasOwnProp$
|
|
17359
|
+
if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
17360
17360
|
target[prop] = source[prop];
|
|
17361
|
-
if (source != null && __getOwnPropSymbols$
|
|
17362
|
-
for (var prop of __getOwnPropSymbols$
|
|
17363
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
17361
|
+
if (source != null && __getOwnPropSymbols$x)
|
|
17362
|
+
for (var prop of __getOwnPropSymbols$x(source)) {
|
|
17363
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
|
|
17364
17364
|
target[prop] = source[prop];
|
|
17365
17365
|
}
|
|
17366
17366
|
return target;
|
|
@@ -17369,9 +17369,9 @@ class TileAdapter extends BaseAdapter {
|
|
|
17369
17369
|
addLayer(options) {
|
|
17370
17370
|
this.options = Object.assign(this.options, options);
|
|
17371
17371
|
if (options) {
|
|
17372
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17372
|
+
const _a = options, { url } = _a, opt = __objRest$4(_a, ["url"]);
|
|
17373
17373
|
if (url) {
|
|
17374
|
-
const tileLayerOptions = __spreadValues$
|
|
17374
|
+
const tileLayerOptions = __spreadValues$w({
|
|
17375
17375
|
pane: this.pane,
|
|
17376
17376
|
attribution: opt.attribution,
|
|
17377
17377
|
minZoom: opt.minZoom,
|
|
@@ -17382,7 +17382,7 @@ class TileAdapter extends BaseAdapter {
|
|
|
17382
17382
|
}
|
|
17383
17383
|
let layer;
|
|
17384
17384
|
if (opt.headers) {
|
|
17385
|
-
layer = new TileLayer(url, __spreadProps$h(__spreadValues$
|
|
17385
|
+
layer = new TileLayer(url, __spreadProps$h(__spreadValues$w({}, tileLayerOptions), {
|
|
17386
17386
|
headers: opt.headers,
|
|
17387
17387
|
setViewDelay: opt.setViewDelay
|
|
17388
17388
|
}));
|
|
@@ -17405,21 +17405,21 @@ class TileAdapter extends BaseAdapter {
|
|
|
17405
17405
|
}
|
|
17406
17406
|
}
|
|
17407
17407
|
|
|
17408
|
-
var __defProp$
|
|
17408
|
+
var __defProp$K = Object.defineProperty;
|
|
17409
17409
|
var __defProps$g = Object.defineProperties;
|
|
17410
17410
|
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
17411
|
-
var __getOwnPropSymbols$
|
|
17412
|
-
var __hasOwnProp$
|
|
17413
|
-
var __propIsEnum$
|
|
17414
|
-
var __defNormalProp$
|
|
17415
|
-
var __spreadValues$
|
|
17411
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
17412
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
17413
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
17414
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17415
|
+
var __spreadValues$v = (a, b) => {
|
|
17416
17416
|
for (var prop in b || (b = {}))
|
|
17417
|
-
if (__hasOwnProp$
|
|
17418
|
-
__defNormalProp$
|
|
17419
|
-
if (__getOwnPropSymbols$
|
|
17420
|
-
for (var prop of __getOwnPropSymbols$
|
|
17421
|
-
if (__propIsEnum$
|
|
17422
|
-
__defNormalProp$
|
|
17417
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
17418
|
+
__defNormalProp$K(a, prop, b[prop]);
|
|
17419
|
+
if (__getOwnPropSymbols$w)
|
|
17420
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
17421
|
+
if (__propIsEnum$w.call(b, prop))
|
|
17422
|
+
__defNormalProp$K(a, prop, b[prop]);
|
|
17423
17423
|
}
|
|
17424
17424
|
return a;
|
|
17425
17425
|
};
|
|
@@ -17427,7 +17427,7 @@ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
|
17427
17427
|
class OsmAdapter extends TileAdapter {
|
|
17428
17428
|
addLayer(options) {
|
|
17429
17429
|
const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
|
17430
|
-
return super.addLayer(__spreadProps$g(__spreadValues$
|
|
17430
|
+
return super.addLayer(__spreadProps$g(__spreadValues$v({
|
|
17431
17431
|
name: "OpenStreetMap",
|
|
17432
17432
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
17433
17433
|
}, options), {
|
|
@@ -17443,33 +17443,33 @@ class WmsLayerBase extends leafletSrcExports.TileLayer.WMS {
|
|
|
17443
17443
|
}
|
|
17444
17444
|
const WmsLayer = makeRemote(WmsLayerBase);
|
|
17445
17445
|
|
|
17446
|
-
var __defProp$
|
|
17446
|
+
var __defProp$J = Object.defineProperty;
|
|
17447
17447
|
var __defProps$f = Object.defineProperties;
|
|
17448
17448
|
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
17449
|
-
var __getOwnPropSymbols$
|
|
17450
|
-
var __hasOwnProp$
|
|
17451
|
-
var __propIsEnum$
|
|
17452
|
-
var __defNormalProp$
|
|
17453
|
-
var __spreadValues$
|
|
17454
|
-
for (var prop in b || (b = {}))
|
|
17455
|
-
if (__hasOwnProp$
|
|
17456
|
-
__defNormalProp$
|
|
17457
|
-
if (__getOwnPropSymbols$
|
|
17458
|
-
for (var prop of __getOwnPropSymbols$
|
|
17459
|
-
if (__propIsEnum$
|
|
17460
|
-
__defNormalProp$
|
|
17449
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
17450
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
17451
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
17452
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17453
|
+
var __spreadValues$u = (a, b) => {
|
|
17454
|
+
for (var prop in b || (b = {}))
|
|
17455
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
17456
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
17457
|
+
if (__getOwnPropSymbols$v)
|
|
17458
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
17459
|
+
if (__propIsEnum$v.call(b, prop))
|
|
17460
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
17461
17461
|
}
|
|
17462
17462
|
return a;
|
|
17463
17463
|
};
|
|
17464
17464
|
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
17465
|
-
var __objRest$
|
|
17465
|
+
var __objRest$3 = (source, exclude) => {
|
|
17466
17466
|
var target = {};
|
|
17467
17467
|
for (var prop in source)
|
|
17468
|
-
if (__hasOwnProp$
|
|
17468
|
+
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
17469
17469
|
target[prop] = source[prop];
|
|
17470
|
-
if (source != null && __getOwnPropSymbols$
|
|
17471
|
-
for (var prop of __getOwnPropSymbols$
|
|
17472
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
17470
|
+
if (source != null && __getOwnPropSymbols$v)
|
|
17471
|
+
for (var prop of __getOwnPropSymbols$v(source)) {
|
|
17472
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
|
|
17473
17473
|
target[prop] = source[prop];
|
|
17474
17474
|
}
|
|
17475
17475
|
return target;
|
|
@@ -17477,9 +17477,9 @@ var __objRest$2 = (source, exclude) => {
|
|
|
17477
17477
|
class WmsAdapter extends BaseAdapter {
|
|
17478
17478
|
addLayer(options) {
|
|
17479
17479
|
Object.assign(this.options, options);
|
|
17480
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17480
|
+
const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
|
|
17481
17481
|
if (url) {
|
|
17482
|
-
const layerOptions = __spreadValues$
|
|
17482
|
+
const layerOptions = __spreadValues$u({
|
|
17483
17483
|
pane: this.pane,
|
|
17484
17484
|
attribution: opt.attribution,
|
|
17485
17485
|
minZoom: opt.minZoom,
|
|
@@ -17490,7 +17490,7 @@ class WmsAdapter extends BaseAdapter {
|
|
|
17490
17490
|
}, options.nativeOptions);
|
|
17491
17491
|
let layer;
|
|
17492
17492
|
if (opt.headers) {
|
|
17493
|
-
layer = new WmsLayer(url, __spreadProps$f(__spreadValues$
|
|
17493
|
+
layer = new WmsLayer(url, __spreadProps$f(__spreadValues$u({}, layerOptions), { headers: opt.headers }));
|
|
17494
17494
|
} else {
|
|
17495
17495
|
layer = new leafletSrcExports.TileLayer.WMS(url, layerOptions);
|
|
17496
17496
|
}
|
|
@@ -17507,33 +17507,33 @@ function arrayToBoundsExpression(bounds) {
|
|
|
17507
17507
|
];
|
|
17508
17508
|
}
|
|
17509
17509
|
|
|
17510
|
-
var __defProp$
|
|
17511
|
-
var __getOwnPropSymbols$
|
|
17512
|
-
var __hasOwnProp$
|
|
17513
|
-
var __propIsEnum$
|
|
17514
|
-
var __defNormalProp$
|
|
17515
|
-
var __spreadValues$
|
|
17510
|
+
var __defProp$I = Object.defineProperty;
|
|
17511
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
17512
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
17513
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
17514
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17515
|
+
var __spreadValues$t = (a, b) => {
|
|
17516
17516
|
for (var prop in b || (b = {}))
|
|
17517
|
-
if (__hasOwnProp$
|
|
17518
|
-
__defNormalProp$
|
|
17519
|
-
if (__getOwnPropSymbols$
|
|
17520
|
-
for (var prop of __getOwnPropSymbols$
|
|
17521
|
-
if (__propIsEnum$
|
|
17522
|
-
__defNormalProp$
|
|
17517
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
17518
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
17519
|
+
if (__getOwnPropSymbols$u)
|
|
17520
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
17521
|
+
if (__propIsEnum$u.call(b, prop))
|
|
17522
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
17523
17523
|
}
|
|
17524
17524
|
return a;
|
|
17525
17525
|
};
|
|
17526
|
-
var __publicField$
|
|
17526
|
+
var __publicField$w = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17527
17527
|
const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
17528
17528
|
constructor() {
|
|
17529
|
-
__publicField$
|
|
17530
|
-
__publicField$
|
|
17531
|
-
__publicField$
|
|
17532
|
-
__publicField$
|
|
17533
|
-
__publicField$
|
|
17534
|
-
__publicField$
|
|
17535
|
-
__publicField$
|
|
17536
|
-
__publicField$
|
|
17529
|
+
__publicField$w(this, "options", { target: "map" });
|
|
17530
|
+
__publicField$w(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
|
|
17531
|
+
__publicField$w(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
|
|
17532
|
+
__publicField$w(this, "emitter", new EventEmitter());
|
|
17533
|
+
__publicField$w(this, "map");
|
|
17534
|
+
__publicField$w(this, "_resizeObserver");
|
|
17535
|
+
__publicField$w(this, "_unselectCb", []);
|
|
17536
|
+
__publicField$w(this, "_universalEvents", [
|
|
17537
17537
|
"move",
|
|
17538
17538
|
"zoom",
|
|
17539
17539
|
"zoomend",
|
|
@@ -17541,14 +17541,14 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
|
17541
17541
|
"moveend",
|
|
17542
17542
|
"movestart"
|
|
17543
17543
|
]);
|
|
17544
|
-
__publicField$
|
|
17544
|
+
__publicField$w(this, "_positionEvents", [
|
|
17545
17545
|
"mousemove",
|
|
17546
17546
|
"mouseout",
|
|
17547
17547
|
"mouseover"
|
|
17548
17548
|
]);
|
|
17549
17549
|
}
|
|
17550
17550
|
create(options) {
|
|
17551
|
-
this.options = __spreadValues$
|
|
17551
|
+
this.options = __spreadValues$t({}, options);
|
|
17552
17552
|
if (this.options.target) {
|
|
17553
17553
|
const {
|
|
17554
17554
|
zoom,
|
|
@@ -17558,7 +17558,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
|
17558
17558
|
maxBounds: mb,
|
|
17559
17559
|
mapAdapterOptions
|
|
17560
17560
|
} = this.options;
|
|
17561
|
-
this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$
|
|
17561
|
+
this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$t({
|
|
17562
17562
|
attributionControl: false,
|
|
17563
17563
|
zoomControl: false,
|
|
17564
17564
|
maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
|
|
@@ -17841,7 +17841,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
|
17841
17841
|
}
|
|
17842
17842
|
}
|
|
17843
17843
|
};
|
|
17844
|
-
__publicField$
|
|
17844
|
+
__publicField$w(_LeafletMapAdapter, "layerAdapters", {
|
|
17845
17845
|
GEOJSON: GeoJsonAdapter,
|
|
17846
17846
|
IMAGE: ImageAdapter,
|
|
17847
17847
|
TILE: TileAdapter,
|
|
@@ -17849,315 +17849,13 @@ __publicField$A(_LeafletMapAdapter, "layerAdapters", {
|
|
|
17849
17849
|
// // MVT: MvtAdapter,
|
|
17850
17850
|
OSM: OsmAdapter
|
|
17851
17851
|
});
|
|
17852
|
-
__publicField$
|
|
17852
|
+
__publicField$w(_LeafletMapAdapter, "controlAdapters", {
|
|
17853
17853
|
ZOOM: leafletSrcExports.Control.Zoom,
|
|
17854
17854
|
ATTRIBUTION: AttributionControl
|
|
17855
17855
|
});
|
|
17856
|
-
__publicField$
|
|
17856
|
+
__publicField$w(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
|
|
17857
17857
|
let LeafletMapAdapter = _LeafletMapAdapter;
|
|
17858
17858
|
|
|
17859
|
-
var __defProp$K = Object.defineProperty;
|
|
17860
|
-
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17861
|
-
var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17862
|
-
class CancelError extends Error {
|
|
17863
|
-
constructor() {
|
|
17864
|
-
super();
|
|
17865
|
-
__publicField$z(this, "name", "CancelError");
|
|
17866
|
-
Object.setPrototypeOf(this, CancelError.prototype);
|
|
17867
|
-
}
|
|
17868
|
-
}
|
|
17869
|
-
|
|
17870
|
-
var __defProp$J = Object.defineProperty;
|
|
17871
|
-
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17872
|
-
var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17873
|
-
class PromiseControl {
|
|
17874
|
-
constructor(options = {}) {
|
|
17875
|
-
this.options = options;
|
|
17876
|
-
__publicField$y(this, "_promises", /* @__PURE__ */ new Map());
|
|
17877
|
-
}
|
|
17878
|
-
get isLoaded() {
|
|
17879
|
-
return this._promises.size > 0;
|
|
17880
|
-
}
|
|
17881
|
-
remove(promise) {
|
|
17882
|
-
if (this._promises.has(promise)) {
|
|
17883
|
-
this._promises.delete(promise);
|
|
17884
|
-
this._onStop();
|
|
17885
|
-
}
|
|
17886
|
-
}
|
|
17887
|
-
get(promise) {
|
|
17888
|
-
return this._promises.get(promise);
|
|
17889
|
-
}
|
|
17890
|
-
add(promise, name) {
|
|
17891
|
-
const key = name ? name : promise;
|
|
17892
|
-
const exist = this._promises.get(key);
|
|
17893
|
-
if (this.options.onStart && !this.isLoaded) {
|
|
17894
|
-
this.options.onStart();
|
|
17895
|
-
}
|
|
17896
|
-
if (exist) {
|
|
17897
|
-
return exist;
|
|
17898
|
-
}
|
|
17899
|
-
this._promises.set(key, promise);
|
|
17900
|
-
promise.finally(() => {
|
|
17901
|
-
this.remove(key);
|
|
17902
|
-
});
|
|
17903
|
-
return promise;
|
|
17904
|
-
}
|
|
17905
|
-
abort() {
|
|
17906
|
-
if (this.isLoaded) {
|
|
17907
|
-
this._promises.forEach((x) => {
|
|
17908
|
-
if (x.cancel) {
|
|
17909
|
-
x.cancel();
|
|
17910
|
-
}
|
|
17911
|
-
});
|
|
17912
|
-
this._promises.clear();
|
|
17913
|
-
this._onStop();
|
|
17914
|
-
}
|
|
17915
|
-
}
|
|
17916
|
-
waitFunc(func, name = "") {
|
|
17917
|
-
name = name || func.name;
|
|
17918
|
-
const exist = this.get(name);
|
|
17919
|
-
if (exist) {
|
|
17920
|
-
return exist;
|
|
17921
|
-
}
|
|
17922
|
-
return this.add(func(), name);
|
|
17923
|
-
}
|
|
17924
|
-
WaitForMe(name = "") {
|
|
17925
|
-
const get = this.get.bind(this);
|
|
17926
|
-
const add = this.add.bind(this);
|
|
17927
|
-
return function(target, key, descriptor) {
|
|
17928
|
-
const originalMethod = descriptor.value;
|
|
17929
|
-
name = name || key;
|
|
17930
|
-
descriptor.value = function(...args) {
|
|
17931
|
-
const exist = get(name);
|
|
17932
|
-
if (exist) {
|
|
17933
|
-
return exist;
|
|
17934
|
-
}
|
|
17935
|
-
const result = add(originalMethod.apply(this, args), name);
|
|
17936
|
-
return result;
|
|
17937
|
-
};
|
|
17938
|
-
return descriptor;
|
|
17939
|
-
};
|
|
17940
|
-
}
|
|
17941
|
-
/** @deprecated use {@link PromiseControl.WaitForMe } instead */
|
|
17942
|
-
GetOrCreateDecorator(name = "") {
|
|
17943
|
-
return this.WaitForMe(name);
|
|
17944
|
-
}
|
|
17945
|
-
_onStop() {
|
|
17946
|
-
if (this.options.onStop && !this.isLoaded) {
|
|
17947
|
-
this.options.onStop();
|
|
17948
|
-
}
|
|
17949
|
-
}
|
|
17950
|
-
}
|
|
17951
|
-
|
|
17952
|
-
var __defProp$I = Object.defineProperty;
|
|
17953
|
-
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17954
|
-
var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17955
|
-
class TimeoutError extends Error {
|
|
17956
|
-
constructor() {
|
|
17957
|
-
super();
|
|
17958
|
-
__publicField$x(this, "name", "TimeoutError");
|
|
17959
|
-
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
17960
|
-
}
|
|
17961
|
-
}
|
|
17962
|
-
|
|
17963
|
-
var __defProp$H = Object.defineProperty;
|
|
17964
|
-
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17965
|
-
var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17966
|
-
var _a;
|
|
17967
|
-
const handleCallback = (resolve, reject, callback, r) => {
|
|
17968
|
-
try {
|
|
17969
|
-
resolve(callback(r));
|
|
17970
|
-
} catch (e) {
|
|
17971
|
-
reject(e);
|
|
17972
|
-
}
|
|
17973
|
-
};
|
|
17974
|
-
let ID$3 = 0;
|
|
17975
|
-
_a = Symbol.toStringTag;
|
|
17976
|
-
const _CancelablePromise = class _CancelablePromise {
|
|
17977
|
-
constructor(executor, timeout) {
|
|
17978
|
-
// @ts-ignore
|
|
17979
|
-
__publicField$w(this, _a);
|
|
17980
|
-
__publicField$w(this, "id", ID$3++);
|
|
17981
|
-
__publicField$w(this, "_isCanceled", false);
|
|
17982
|
-
__publicField$w(this, "_isPending", true);
|
|
17983
|
-
__publicField$w(this, "_promise");
|
|
17984
|
-
__publicField$w(this, "_cancelPromise");
|
|
17985
|
-
__publicField$w(this, "_cancelHandlers", []);
|
|
17986
|
-
__publicField$w(this, "_setCanceledCallback");
|
|
17987
|
-
__publicField$w(this, "_parentPromise");
|
|
17988
|
-
__publicField$w(this, "_children", []);
|
|
17989
|
-
this._cancelPromise = new Promise((resolve_, reject_) => {
|
|
17990
|
-
this._setCanceledCallback = (er) => resolve_(er || new CancelError());
|
|
17991
|
-
});
|
|
17992
|
-
const promises = [
|
|
17993
|
-
this._cancelPromise,
|
|
17994
|
-
new Promise((resolve, reject) => {
|
|
17995
|
-
const onResolve = (value) => {
|
|
17996
|
-
if (value instanceof _CancelablePromise) {
|
|
17997
|
-
this.attach(value);
|
|
17998
|
-
} else {
|
|
17999
|
-
this._isPending = false;
|
|
18000
|
-
}
|
|
18001
|
-
resolve(value);
|
|
18002
|
-
};
|
|
18003
|
-
const onReject = (error) => {
|
|
18004
|
-
this._isPending = false;
|
|
18005
|
-
reject(error);
|
|
18006
|
-
};
|
|
18007
|
-
const onCancel = (handler) => {
|
|
18008
|
-
if (!this._isPending) {
|
|
18009
|
-
throw new Error(
|
|
18010
|
-
"The `onCancel` handler was attached after the promise settled."
|
|
18011
|
-
);
|
|
18012
|
-
}
|
|
18013
|
-
this._cancelHandlers.push(handler);
|
|
18014
|
-
};
|
|
18015
|
-
return executor(onResolve, onReject, onCancel);
|
|
18016
|
-
})
|
|
18017
|
-
];
|
|
18018
|
-
if (timeout) {
|
|
18019
|
-
promises.push(
|
|
18020
|
-
new Promise((resolve, reject) => {
|
|
18021
|
-
setTimeout(() => {
|
|
18022
|
-
if (this._isPending) {
|
|
18023
|
-
try {
|
|
18024
|
-
this.cancel();
|
|
18025
|
-
} finally {
|
|
18026
|
-
reject(new TimeoutError());
|
|
18027
|
-
}
|
|
18028
|
-
}
|
|
18029
|
-
}, timeout);
|
|
18030
|
-
})
|
|
18031
|
-
);
|
|
18032
|
-
}
|
|
18033
|
-
this._promise = Promise.race(promises);
|
|
18034
|
-
}
|
|
18035
|
-
static createControl(opt) {
|
|
18036
|
-
return new PromiseControl(opt);
|
|
18037
|
-
}
|
|
18038
|
-
static resolve(value) {
|
|
18039
|
-
return new _CancelablePromise((resolve) => resolve(value));
|
|
18040
|
-
}
|
|
18041
|
-
static reject(value) {
|
|
18042
|
-
return new _CancelablePromise((resolve, reject) => reject(value));
|
|
18043
|
-
}
|
|
18044
|
-
static all(values) {
|
|
18045
|
-
return new _CancelablePromise((resolve, reject) => {
|
|
18046
|
-
Promise.all(values).then(resolve).catch(reject);
|
|
18047
|
-
}).catch((er) => {
|
|
18048
|
-
if (er instanceof this.CancelError) {
|
|
18049
|
-
for (const v of values) {
|
|
18050
|
-
const v_ = v;
|
|
18051
|
-
if ("cancel" in v_) {
|
|
18052
|
-
v_.cancel();
|
|
18053
|
-
}
|
|
18054
|
-
}
|
|
18055
|
-
}
|
|
18056
|
-
throw er;
|
|
18057
|
-
});
|
|
18058
|
-
}
|
|
18059
|
-
attach(p) {
|
|
18060
|
-
if (this._isCanceled) {
|
|
18061
|
-
p.cancel();
|
|
18062
|
-
} else {
|
|
18063
|
-
this._children.push(p);
|
|
18064
|
-
}
|
|
18065
|
-
}
|
|
18066
|
-
then(onfulfilled, onrejected) {
|
|
18067
|
-
const p = new _CancelablePromise((resolve, reject) => {
|
|
18068
|
-
if (this._promise) {
|
|
18069
|
-
const reject_ = (r) => {
|
|
18070
|
-
if (onrejected) {
|
|
18071
|
-
handleCallback(resolve, reject, onrejected, r);
|
|
18072
|
-
} else {
|
|
18073
|
-
reject(r);
|
|
18074
|
-
}
|
|
18075
|
-
};
|
|
18076
|
-
this._promise.then((r) => {
|
|
18077
|
-
if (this._isCanceled) {
|
|
18078
|
-
reject_(r);
|
|
18079
|
-
} else {
|
|
18080
|
-
if (onfulfilled) {
|
|
18081
|
-
handleCallback(resolve, reject, onfulfilled, r);
|
|
18082
|
-
} else {
|
|
18083
|
-
resolve(r);
|
|
18084
|
-
}
|
|
18085
|
-
}
|
|
18086
|
-
}, reject_);
|
|
18087
|
-
}
|
|
18088
|
-
});
|
|
18089
|
-
p._parentPromise = this;
|
|
18090
|
-
this._children.push(p);
|
|
18091
|
-
return p;
|
|
18092
|
-
}
|
|
18093
|
-
catch(onrejected) {
|
|
18094
|
-
if (this._isCanceled && onrejected) {
|
|
18095
|
-
onrejected(new CancelError());
|
|
18096
|
-
}
|
|
18097
|
-
return this.then(void 0, onrejected);
|
|
18098
|
-
}
|
|
18099
|
-
finally(onfinally) {
|
|
18100
|
-
if (this._promise) {
|
|
18101
|
-
return this._promise.finally(onfinally);
|
|
18102
|
-
}
|
|
18103
|
-
if (this._isCanceled) {
|
|
18104
|
-
return Promise.reject(new CancelError());
|
|
18105
|
-
}
|
|
18106
|
-
return Promise.reject(onfinally);
|
|
18107
|
-
}
|
|
18108
|
-
cancel() {
|
|
18109
|
-
if (this._isCanceled || !this._isPending) {
|
|
18110
|
-
return this;
|
|
18111
|
-
}
|
|
18112
|
-
this._isCanceled = true;
|
|
18113
|
-
const parent = this._getTopParent();
|
|
18114
|
-
if (parent) {
|
|
18115
|
-
parent.cancel();
|
|
18116
|
-
}
|
|
18117
|
-
if (this._children) {
|
|
18118
|
-
this._children.forEach((x) => x.cancel());
|
|
18119
|
-
}
|
|
18120
|
-
if (this._isPending) {
|
|
18121
|
-
if (this._cancelHandlers.length) {
|
|
18122
|
-
try {
|
|
18123
|
-
for (const handler of this._cancelHandlers) {
|
|
18124
|
-
handler();
|
|
18125
|
-
}
|
|
18126
|
-
} catch (error) {
|
|
18127
|
-
}
|
|
18128
|
-
}
|
|
18129
|
-
if (this._setCanceledCallback) {
|
|
18130
|
-
this._setCanceledCallback();
|
|
18131
|
-
}
|
|
18132
|
-
}
|
|
18133
|
-
this._destroy();
|
|
18134
|
-
return this;
|
|
18135
|
-
}
|
|
18136
|
-
_getTopParent() {
|
|
18137
|
-
let parent = this._parentPromise;
|
|
18138
|
-
let hasParent = !!parent;
|
|
18139
|
-
while (hasParent) {
|
|
18140
|
-
if (parent && parent._parentPromise) {
|
|
18141
|
-
parent = parent._parentPromise;
|
|
18142
|
-
hasParent = !!parent;
|
|
18143
|
-
} else {
|
|
18144
|
-
hasParent = false;
|
|
18145
|
-
}
|
|
18146
|
-
}
|
|
18147
|
-
return parent;
|
|
18148
|
-
}
|
|
18149
|
-
_destroy() {
|
|
18150
|
-
this._setCanceledCallback = void 0;
|
|
18151
|
-
this._cancelPromise = void 0;
|
|
18152
|
-
this._promise = void 0;
|
|
18153
|
-
}
|
|
18154
|
-
};
|
|
18155
|
-
__publicField$w(_CancelablePromise, "CancelError", CancelError);
|
|
18156
|
-
__publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
|
|
18157
|
-
__publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
|
|
18158
|
-
let CancelablePromise = _CancelablePromise;
|
|
18159
|
-
Object.setPrototypeOf(CancelablePromise.prototype, Promise.prototype);
|
|
18160
|
-
|
|
18161
17859
|
const svgPath = {
|
|
18162
17860
|
brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
|
|
18163
17861
|
circle: '<circle cx="6" cy="6" r="6"/>',
|
|
@@ -18230,9 +17928,9 @@ function getIcon(opt = {}) {
|
|
|
18230
17928
|
};
|
|
18231
17929
|
}
|
|
18232
17930
|
|
|
18233
|
-
var __defProp$
|
|
18234
|
-
var __defNormalProp$
|
|
18235
|
-
var __publicField$v = (obj, key, value) => __defNormalProp$
|
|
17931
|
+
var __defProp$H = Object.defineProperty;
|
|
17932
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17933
|
+
var __publicField$v = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18236
17934
|
const _Cache = class _Cache {
|
|
18237
17935
|
constructor(options = {}) {
|
|
18238
17936
|
__publicField$v(this, "cache", []);
|
|
@@ -18268,8 +17966,7 @@ const _Cache = class _Cache {
|
|
|
18268
17966
|
* // somewhere else in the code
|
|
18269
17967
|
* const item = await cache.addFull('foo', getItemFunc).then((resp) => {
|
|
18270
17968
|
* console.log(resp); // 'New item'
|
|
18271
|
-
* })
|
|
18272
|
-
*
|
|
17969
|
+
* });
|
|
18273
17970
|
* ```
|
|
18274
17971
|
*/
|
|
18275
17972
|
addFull(key, valueToSet, props) {
|
|
@@ -18284,13 +17981,11 @@ const _Cache = class _Cache {
|
|
|
18284
17981
|
} else {
|
|
18285
17982
|
value = valueToSet;
|
|
18286
17983
|
}
|
|
18287
|
-
const
|
|
17984
|
+
const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
|
|
18288
17985
|
const cacheItem = {
|
|
18289
17986
|
key,
|
|
18290
17987
|
value,
|
|
18291
|
-
props:
|
|
18292
|
-
// TODO: remove backward compatibility use only props
|
|
18293
|
-
options: props_
|
|
17988
|
+
props: nonEmptyProps
|
|
18294
17989
|
};
|
|
18295
17990
|
if (onlyFull && !full(value)) {
|
|
18296
17991
|
return value;
|
|
@@ -18299,7 +17994,6 @@ const _Cache = class _Cache {
|
|
|
18299
17994
|
if (value instanceof Promise) {
|
|
18300
17995
|
value.catch((er) => {
|
|
18301
17996
|
this.delete(key, props);
|
|
18302
|
-
throw er;
|
|
18303
17997
|
});
|
|
18304
17998
|
if (onlyFull) {
|
|
18305
17999
|
value.then((x) => {
|
|
@@ -18318,9 +18012,7 @@ const _Cache = class _Cache {
|
|
|
18318
18012
|
}
|
|
18319
18013
|
match(key, props) {
|
|
18320
18014
|
const cacheRecord = this._find(key, props);
|
|
18321
|
-
|
|
18322
|
-
return cacheRecord.value;
|
|
18323
|
-
}
|
|
18015
|
+
return cacheRecord == null ? void 0 : cacheRecord.value;
|
|
18324
18016
|
}
|
|
18325
18017
|
matchAll(key, props) {
|
|
18326
18018
|
if (key) {
|
|
@@ -18329,37 +18021,30 @@ const _Cache = class _Cache {
|
|
|
18329
18021
|
return this.cache.map((x) => x.value);
|
|
18330
18022
|
}
|
|
18331
18023
|
delete(keyOrItem, props) {
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
for (const e of exist) {
|
|
18339
|
-
const index = this.cache.indexOf(e);
|
|
18340
|
-
this.cache.splice(index, 1);
|
|
18024
|
+
const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
|
|
18025
|
+
for (const item of itemsToDelete) {
|
|
18026
|
+
const index = this.cache.indexOf(item);
|
|
18027
|
+
if (index !== -1) {
|
|
18028
|
+
this.cache.splice(index, 1);
|
|
18029
|
+
}
|
|
18341
18030
|
}
|
|
18342
18031
|
}
|
|
18343
18032
|
_find(key, props) {
|
|
18344
18033
|
return this.cache.find((x) => this._filter(x, key, props));
|
|
18345
18034
|
}
|
|
18346
18035
|
_filter(item, key, props) {
|
|
18347
|
-
if (item.key
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
}
|
|
18352
|
-
return true;
|
|
18353
|
-
}
|
|
18354
|
-
return false;
|
|
18036
|
+
if (item.key !== key) return false;
|
|
18037
|
+
if (!props) return true;
|
|
18038
|
+
const itemProps = item.props;
|
|
18039
|
+
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
18355
18040
|
}
|
|
18356
18041
|
};
|
|
18357
18042
|
__publicField$v(_Cache, "instance", {});
|
|
18358
18043
|
let Cache = _Cache;
|
|
18359
18044
|
|
|
18360
|
-
var __defProp$
|
|
18361
|
-
var __defNormalProp$
|
|
18362
|
-
var __publicField$u = (obj, key, value) => __defNormalProp$
|
|
18045
|
+
var __defProp$G = Object.defineProperty;
|
|
18046
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18047
|
+
var __publicField$u = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18363
18048
|
class NgwError extends Error {
|
|
18364
18049
|
constructor(er) {
|
|
18365
18050
|
super();
|
|
@@ -18376,9 +18061,9 @@ class NgwError extends Error {
|
|
|
18376
18061
|
}
|
|
18377
18062
|
}
|
|
18378
18063
|
|
|
18379
|
-
var __defProp$
|
|
18380
|
-
var __defNormalProp$
|
|
18381
|
-
var __publicField$t = (obj, key, value) => __defNormalProp$
|
|
18064
|
+
var __defProp$F = Object.defineProperty;
|
|
18065
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18066
|
+
var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18382
18067
|
class ResourceNotFoundError extends NgwError {
|
|
18383
18068
|
constructor(obj) {
|
|
18384
18069
|
super(obj);
|
|
@@ -18417,27 +18102,24 @@ function resourceToQuery(resource, prefix = "") {
|
|
|
18417
18102
|
return query;
|
|
18418
18103
|
}
|
|
18419
18104
|
|
|
18420
|
-
var __defProp$
|
|
18421
|
-
var
|
|
18422
|
-
var
|
|
18423
|
-
var
|
|
18424
|
-
var
|
|
18425
|
-
var
|
|
18426
|
-
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18427
|
-
var __spreadValues$q = (a, b) => {
|
|
18105
|
+
var __defProp$E = Object.defineProperty;
|
|
18106
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
18107
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
18108
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
18109
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18110
|
+
var __spreadValues$s = (a, b) => {
|
|
18428
18111
|
for (var prop in b || (b = {}))
|
|
18429
|
-
if (__hasOwnProp$
|
|
18430
|
-
__defNormalProp$
|
|
18431
|
-
if (__getOwnPropSymbols$
|
|
18432
|
-
for (var prop of __getOwnPropSymbols$
|
|
18433
|
-
if (__propIsEnum$
|
|
18434
|
-
__defNormalProp$
|
|
18112
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
18113
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
18114
|
+
if (__getOwnPropSymbols$t)
|
|
18115
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
18116
|
+
if (__propIsEnum$t.call(b, prop))
|
|
18117
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
18435
18118
|
}
|
|
18436
18119
|
return a;
|
|
18437
18120
|
};
|
|
18438
|
-
var
|
|
18439
|
-
var
|
|
18440
|
-
var __async$k = (__this, __arguments, generator) => {
|
|
18121
|
+
var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18122
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
18441
18123
|
return new Promise((resolve, reject) => {
|
|
18442
18124
|
var fulfilled = (value) => {
|
|
18443
18125
|
try {
|
|
@@ -18478,39 +18160,27 @@ class ResourcesControl {
|
|
|
18478
18160
|
* Fetching resource would be cached to speed up next call
|
|
18479
18161
|
*/
|
|
18480
18162
|
getOne(resource, requestOptions) {
|
|
18481
|
-
const
|
|
18482
|
-
|
|
18483
|
-
const opt = __spreadProps$e(__spreadValues$q({}, requestOptions), { cache: false });
|
|
18484
|
-
if (typeof resource === "string") {
|
|
18485
|
-
forCache.keyname = resource;
|
|
18486
|
-
} else if (typeof resource === "number") {
|
|
18487
|
-
forCache.id = resource;
|
|
18488
|
-
} else if (isObject(resource)) {
|
|
18163
|
+
const opt = __spreadValues$s({}, requestOptions);
|
|
18164
|
+
if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
|
|
18489
18165
|
if (resource.id !== void 0) {
|
|
18490
|
-
|
|
18166
|
+
resource.id;
|
|
18491
18167
|
} else {
|
|
18492
18168
|
if (resource.keyname) {
|
|
18493
|
-
|
|
18169
|
+
resource.keyname;
|
|
18494
18170
|
}
|
|
18495
18171
|
if (resource.display_name) {
|
|
18496
|
-
|
|
18172
|
+
resource.display_name;
|
|
18497
18173
|
}
|
|
18498
18174
|
}
|
|
18499
18175
|
}
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
return this._fetchResourceBy(resource, opt);
|
|
18507
|
-
}
|
|
18508
|
-
return CancelablePromise.resolve(void 0);
|
|
18509
|
-
};
|
|
18510
|
-
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
18511
|
-
return cache.addFull("resource", makeRequest, forCache);
|
|
18176
|
+
if (typeof resource === "string") {
|
|
18177
|
+
return this._fetchResourceBy({ keyname: resource }, opt);
|
|
18178
|
+
} else if (typeof resource === "number") {
|
|
18179
|
+
return this._fetchResourceById(resource, opt);
|
|
18180
|
+
} else if (isObject(resource)) {
|
|
18181
|
+
return this._fetchResourceBy(resource, opt);
|
|
18512
18182
|
}
|
|
18513
|
-
return
|
|
18183
|
+
return Promise.resolve(void 0);
|
|
18514
18184
|
}
|
|
18515
18185
|
getOneOrFail(resource, requestOptions) {
|
|
18516
18186
|
return this.getOne(resource, requestOptions).then((res) => {
|
|
@@ -18532,7 +18202,7 @@ class ResourcesControl {
|
|
|
18532
18202
|
*/
|
|
18533
18203
|
getId(resource, requestOptions) {
|
|
18534
18204
|
if (typeof resource === "number") {
|
|
18535
|
-
return
|
|
18205
|
+
return Promise.resolve(resource);
|
|
18536
18206
|
} else if (typeof resource === "string" || isObject(resource)) {
|
|
18537
18207
|
return this.getOne(resource, requestOptions).then((res) => {
|
|
18538
18208
|
if (res) {
|
|
@@ -18540,7 +18210,7 @@ class ResourcesControl {
|
|
|
18540
18210
|
}
|
|
18541
18211
|
});
|
|
18542
18212
|
}
|
|
18543
|
-
return
|
|
18213
|
+
return Promise.resolve(void 0);
|
|
18544
18214
|
}
|
|
18545
18215
|
/**
|
|
18546
18216
|
* A fast way to retrieve resource ID for any resource definition.
|
|
@@ -18567,12 +18237,12 @@ class ResourcesControl {
|
|
|
18567
18237
|
} else {
|
|
18568
18238
|
Object.assign(query, resourceToQuery(resource));
|
|
18569
18239
|
}
|
|
18570
|
-
return this.connector.get("resource.search", requestOptions, __spreadValues$
|
|
18240
|
+
return this.connector.get("resource.search", requestOptions, __spreadValues$s({
|
|
18571
18241
|
serialization: "full"
|
|
18572
18242
|
}, query)).then((resources) => {
|
|
18573
|
-
if (resources) {
|
|
18243
|
+
if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
|
|
18574
18244
|
for (const x of resources) {
|
|
18575
|
-
this.cache.add("resource.item",
|
|
18245
|
+
this.cache.add("resource.item", Promise.resolve(x), {
|
|
18576
18246
|
id: x.resource.id
|
|
18577
18247
|
});
|
|
18578
18248
|
}
|
|
@@ -18588,7 +18258,7 @@ class ResourcesControl {
|
|
|
18588
18258
|
if (child) {
|
|
18589
18259
|
return this.getOne(child.resource.parent.id, requestOptions);
|
|
18590
18260
|
}
|
|
18591
|
-
return
|
|
18261
|
+
return Promise.resolve(void 0);
|
|
18592
18262
|
});
|
|
18593
18263
|
}
|
|
18594
18264
|
getChildrenOf(resource, requestOptions) {
|
|
@@ -18618,18 +18288,16 @@ class ResourcesControl {
|
|
|
18618
18288
|
});
|
|
18619
18289
|
}
|
|
18620
18290
|
_getChildrenOf(parent, requestOptions, _items = []) {
|
|
18621
|
-
return this.connector.get(
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
{
|
|
18625
|
-
parent
|
|
18626
|
-
}
|
|
18627
|
-
).then((items) => {
|
|
18291
|
+
return this.connector.get("resource.collection", requestOptions, {
|
|
18292
|
+
parent
|
|
18293
|
+
}).then((items) => {
|
|
18628
18294
|
const recursivePromises = [];
|
|
18629
18295
|
for (const item of items) {
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18296
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
18297
|
+
this.cache.add("resource.item", Promise.resolve(item), {
|
|
18298
|
+
id: item.resource.id
|
|
18299
|
+
});
|
|
18300
|
+
}
|
|
18633
18301
|
_items.push(item);
|
|
18634
18302
|
if ((requestOptions == null ? void 0 : requestOptions.recursive) && item.resource.children) {
|
|
18635
18303
|
recursivePromises.push(
|
|
@@ -18638,7 +18306,7 @@ class ResourcesControl {
|
|
|
18638
18306
|
}
|
|
18639
18307
|
}
|
|
18640
18308
|
if (recursivePromises.length) {
|
|
18641
|
-
return
|
|
18309
|
+
return Promise.all(recursivePromises).then(() => {
|
|
18642
18310
|
return _items;
|
|
18643
18311
|
});
|
|
18644
18312
|
}
|
|
@@ -18646,11 +18314,12 @@ class ResourcesControl {
|
|
|
18646
18314
|
});
|
|
18647
18315
|
}
|
|
18648
18316
|
_cleanResourceItemCache(id) {
|
|
18649
|
-
return __async$
|
|
18317
|
+
return __async$r(this, null, function* () {
|
|
18318
|
+
var _a;
|
|
18650
18319
|
const all = this.cache.all();
|
|
18651
18320
|
const toDelete = [];
|
|
18652
18321
|
for (const c of all) {
|
|
18653
|
-
const cid = c.
|
|
18322
|
+
const cid = (_a = c.props) == null ? void 0 : _a.id;
|
|
18654
18323
|
if (["resource.item", "resource"].includes(c.key) && cid !== void 0) {
|
|
18655
18324
|
if (typeof cid === "number") {
|
|
18656
18325
|
if (cid === id) {
|
|
@@ -18670,18 +18339,7 @@ class ResourcesControl {
|
|
|
18670
18339
|
});
|
|
18671
18340
|
}
|
|
18672
18341
|
_fetchResourceById(id, requestOptions) {
|
|
18673
|
-
|
|
18674
|
-
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
18675
|
-
return this.cache.add("resource.item", promise, {
|
|
18676
|
-
id
|
|
18677
|
-
}).catch((er) => {
|
|
18678
|
-
if (!(er instanceof ResourceNotFoundError)) {
|
|
18679
|
-
throw er;
|
|
18680
|
-
}
|
|
18681
|
-
return void 0;
|
|
18682
|
-
});
|
|
18683
|
-
}
|
|
18684
|
-
return promise();
|
|
18342
|
+
return this.connector.get("resource.item", requestOptions, { id });
|
|
18685
18343
|
}
|
|
18686
18344
|
_fetchResourceBy(resource, requestOptions) {
|
|
18687
18345
|
return this.getMany(resource, requestOptions).then((resources) => {
|
|
@@ -18689,7 +18347,7 @@ class ResourcesControl {
|
|
|
18689
18347
|
});
|
|
18690
18348
|
}
|
|
18691
18349
|
_resourceCacheFilter(resource) {
|
|
18692
|
-
return
|
|
18350
|
+
return Promise.all(this.cache.matchAll("resource.item")).then(
|
|
18693
18351
|
(resources) => {
|
|
18694
18352
|
const items = [];
|
|
18695
18353
|
resources.filter((x) => {
|
|
@@ -18733,9 +18391,16 @@ function removeConnector(connector) {
|
|
|
18733
18391
|
}
|
|
18734
18392
|
}
|
|
18735
18393
|
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18394
|
+
class AbortError extends Error {
|
|
18395
|
+
constructor(message = "AbortError") {
|
|
18396
|
+
super(message);
|
|
18397
|
+
this.name = "AbortError";
|
|
18398
|
+
}
|
|
18399
|
+
}
|
|
18400
|
+
|
|
18401
|
+
var __defProp$D = Object.defineProperty;
|
|
18402
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18403
|
+
var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18739
18404
|
class InsufficientPermissionsError extends NgwError {
|
|
18740
18405
|
constructor(obj) {
|
|
18741
18406
|
super(obj);
|
|
@@ -18758,64 +18423,96 @@ function template(str, data) {
|
|
|
18758
18423
|
});
|
|
18759
18424
|
}
|
|
18760
18425
|
|
|
18426
|
+
var __defProp$C = Object.defineProperty;
|
|
18427
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
18428
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
18429
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
18430
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18431
|
+
var __spreadValues$r = (a, b) => {
|
|
18432
|
+
for (var prop in b || (b = {}))
|
|
18433
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
18434
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
18435
|
+
if (__getOwnPropSymbols$s)
|
|
18436
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
18437
|
+
if (__propIsEnum$s.call(b, prop))
|
|
18438
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
18439
|
+
}
|
|
18440
|
+
return a;
|
|
18441
|
+
};
|
|
18442
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
18443
|
+
return new Promise((resolve, reject) => {
|
|
18444
|
+
var fulfilled = (value) => {
|
|
18445
|
+
try {
|
|
18446
|
+
step(generator.next(value));
|
|
18447
|
+
} catch (e) {
|
|
18448
|
+
reject(e);
|
|
18449
|
+
}
|
|
18450
|
+
};
|
|
18451
|
+
var rejected = (value) => {
|
|
18452
|
+
try {
|
|
18453
|
+
step(generator.throw(value));
|
|
18454
|
+
} catch (e) {
|
|
18455
|
+
reject(e);
|
|
18456
|
+
}
|
|
18457
|
+
};
|
|
18458
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18459
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
18460
|
+
});
|
|
18461
|
+
};
|
|
18761
18462
|
function apiRequest(opt) {
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
"`" + arg + "` url api argument is not specified"
|
|
18777
|
-
);
|
|
18778
|
-
}
|
|
18779
|
-
}
|
|
18780
|
-
if (url) {
|
|
18781
|
-
url = template(url, replaceParams);
|
|
18463
|
+
return __async$q(this, null, function* () {
|
|
18464
|
+
const { params, name, connector, requestOptions } = opt;
|
|
18465
|
+
const apiItems = yield connector.connect();
|
|
18466
|
+
let apiItem = apiItems && apiItems[name];
|
|
18467
|
+
if (apiItem) {
|
|
18468
|
+
apiItem = [...apiItem];
|
|
18469
|
+
let url = apiItem.shift();
|
|
18470
|
+
if (apiItem.length) {
|
|
18471
|
+
const replaceParams = {};
|
|
18472
|
+
for (let fry = 0; fry < apiItem.length; fry++) {
|
|
18473
|
+
const arg = apiItem[fry];
|
|
18474
|
+
replaceParams[fry] = `{${arg}}`;
|
|
18475
|
+
if (params[arg] === void 0) {
|
|
18476
|
+
throw new Error(`\`${arg}\` URL API argument is not specified`);
|
|
18782
18477
|
}
|
|
18783
18478
|
}
|
|
18784
|
-
if (
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18796
|
-
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
url = url + "?" + paramArray.join("&");
|
|
18479
|
+
if (url) {
|
|
18480
|
+
url = template(url, replaceParams);
|
|
18481
|
+
}
|
|
18482
|
+
}
|
|
18483
|
+
if (params) {
|
|
18484
|
+
const paramArray = [];
|
|
18485
|
+
const paramList = params.paramList;
|
|
18486
|
+
if (Array.isArray(paramList)) {
|
|
18487
|
+
paramList.forEach(([key, value]) => {
|
|
18488
|
+
paramArray.push(`${key}=${value}`);
|
|
18489
|
+
});
|
|
18490
|
+
}
|
|
18491
|
+
for (const p in params) {
|
|
18492
|
+
if (apiItem.indexOf(p) === -1) {
|
|
18493
|
+
paramArray.push(`${p}=${params[p]}`);
|
|
18800
18494
|
}
|
|
18801
18495
|
}
|
|
18802
|
-
if (
|
|
18803
|
-
|
|
18804
|
-
} else {
|
|
18805
|
-
reject(new Error("request url is not set"));
|
|
18496
|
+
if (paramArray.length) {
|
|
18497
|
+
url = `${url}?${paramArray.join("&")}`;
|
|
18806
18498
|
}
|
|
18499
|
+
}
|
|
18500
|
+
if (url) {
|
|
18501
|
+
return connector.makeQuery(url, params, __spreadValues$r({
|
|
18502
|
+
cacheName: name
|
|
18503
|
+
}, requestOptions));
|
|
18807
18504
|
} else {
|
|
18808
|
-
|
|
18505
|
+
throw new Error("Request URL is not set");
|
|
18809
18506
|
}
|
|
18810
|
-
}
|
|
18811
|
-
|
|
18812
|
-
}
|
|
18507
|
+
} else {
|
|
18508
|
+
return void 0;
|
|
18509
|
+
}
|
|
18813
18510
|
});
|
|
18814
18511
|
}
|
|
18815
18512
|
|
|
18816
18513
|
var __defProp$B = Object.defineProperty;
|
|
18817
18514
|
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18818
|
-
var __publicField$q = (obj, key, value) => __defNormalProp$B(obj,
|
|
18515
|
+
var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, key + "" , value);
|
|
18819
18516
|
class NetworkError extends Error {
|
|
18820
18517
|
constructor(url) {
|
|
18821
18518
|
super();
|
|
@@ -18909,23 +18606,59 @@ let loadData;
|
|
|
18909
18606
|
}
|
|
18910
18607
|
|
|
18911
18608
|
var __defProp$A = Object.defineProperty;
|
|
18912
|
-
var
|
|
18913
|
-
var
|
|
18914
|
-
var
|
|
18609
|
+
var __defProps$e = Object.defineProperties;
|
|
18610
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
18611
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
18612
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
18613
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
18915
18614
|
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18916
|
-
var __spreadValues$
|
|
18615
|
+
var __spreadValues$q = (a, b) => {
|
|
18917
18616
|
for (var prop in b || (b = {}))
|
|
18918
|
-
if (__hasOwnProp$
|
|
18617
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
18919
18618
|
__defNormalProp$A(a, prop, b[prop]);
|
|
18920
|
-
if (__getOwnPropSymbols$
|
|
18921
|
-
for (var prop of __getOwnPropSymbols$
|
|
18922
|
-
if (__propIsEnum$
|
|
18619
|
+
if (__getOwnPropSymbols$r)
|
|
18620
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
18621
|
+
if (__propIsEnum$r.call(b, prop))
|
|
18923
18622
|
__defNormalProp$A(a, prop, b[prop]);
|
|
18924
18623
|
}
|
|
18925
18624
|
return a;
|
|
18926
18625
|
};
|
|
18626
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
18627
|
+
var __objRest$2 = (source, exclude) => {
|
|
18628
|
+
var target = {};
|
|
18629
|
+
for (var prop in source)
|
|
18630
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
18631
|
+
target[prop] = source[prop];
|
|
18632
|
+
if (source != null && __getOwnPropSymbols$r)
|
|
18633
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
|
18634
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
|
18635
|
+
target[prop] = source[prop];
|
|
18636
|
+
}
|
|
18637
|
+
return target;
|
|
18638
|
+
};
|
|
18927
18639
|
var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18640
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
18641
|
+
return new Promise((resolve, reject) => {
|
|
18642
|
+
var fulfilled = (value) => {
|
|
18643
|
+
try {
|
|
18644
|
+
step(generator.next(value));
|
|
18645
|
+
} catch (e) {
|
|
18646
|
+
reject(e);
|
|
18647
|
+
}
|
|
18648
|
+
};
|
|
18649
|
+
var rejected = (value) => {
|
|
18650
|
+
try {
|
|
18651
|
+
step(generator.throw(value));
|
|
18652
|
+
} catch (e) {
|
|
18653
|
+
reject(e);
|
|
18654
|
+
}
|
|
18655
|
+
};
|
|
18656
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18657
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
18658
|
+
});
|
|
18659
|
+
};
|
|
18928
18660
|
let ID$2 = 0;
|
|
18661
|
+
let REQUEST_ID = 0;
|
|
18929
18662
|
class NgwConnector {
|
|
18930
18663
|
constructor(options) {
|
|
18931
18664
|
this.options = options;
|
|
@@ -18935,7 +18668,7 @@ class NgwConnector {
|
|
|
18935
18668
|
__publicField$p(this, "resources");
|
|
18936
18669
|
__publicField$p(this, "cache");
|
|
18937
18670
|
__publicField$p(this, "routeStr", "/api/component/pyramid/route");
|
|
18938
|
-
__publicField$p(this, "activeRequests",
|
|
18671
|
+
__publicField$p(this, "activeRequests", {});
|
|
18939
18672
|
__publicField$p(this, "requestTransform");
|
|
18940
18673
|
const exist = findConnector(options);
|
|
18941
18674
|
this.cache = new Cache({ namespace: options.cacheId });
|
|
@@ -18992,29 +18725,27 @@ class NgwConnector {
|
|
|
18992
18725
|
* ```
|
|
18993
18726
|
*/
|
|
18994
18727
|
connect() {
|
|
18995
|
-
|
|
18996
|
-
|
|
18997
|
-
const makeQuery = () => {
|
|
18998
|
-
return this.makeQuery(this.routeStr, {}, {}).then((route) => {
|
|
18999
|
-
resolve(route);
|
|
19000
|
-
}).catch((er) => {
|
|
19001
|
-
reject(er);
|
|
19002
|
-
});
|
|
19003
|
-
};
|
|
18728
|
+
return __async$p(this, null, function* () {
|
|
18729
|
+
const auth = this.options.auth;
|
|
19004
18730
|
if (auth) {
|
|
19005
18731
|
const { login, password } = auth;
|
|
19006
18732
|
if (login && password) {
|
|
19007
|
-
|
|
19008
|
-
return makeQuery();
|
|
19009
|
-
}).catch((er) => reject(er));
|
|
18733
|
+
yield this._login({ login, password });
|
|
19010
18734
|
}
|
|
19011
18735
|
}
|
|
19012
|
-
return makeQuery(
|
|
19013
|
-
|
|
19014
|
-
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
|
|
18736
|
+
return yield this.makeQuery(
|
|
18737
|
+
this.routeStr,
|
|
18738
|
+
{},
|
|
18739
|
+
{
|
|
18740
|
+
cacheName: "route",
|
|
18741
|
+
cache: true,
|
|
18742
|
+
cacheProps: {
|
|
18743
|
+
id: this.id,
|
|
18744
|
+
auth,
|
|
18745
|
+
baseUrl: this.options.baseUrl
|
|
18746
|
+
}
|
|
18747
|
+
}
|
|
18748
|
+
);
|
|
19018
18749
|
});
|
|
19019
18750
|
}
|
|
19020
18751
|
/**
|
|
@@ -19038,20 +18769,22 @@ class NgwConnector {
|
|
|
19038
18769
|
this.emitter.emit("logout");
|
|
19039
18770
|
}
|
|
19040
18771
|
getUserInfo(credentials, options) {
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
18772
|
+
return __async$p(this, null, function* () {
|
|
18773
|
+
if (this.user && this.user.id) {
|
|
18774
|
+
return this.user;
|
|
18775
|
+
}
|
|
18776
|
+
if (credentials) {
|
|
18777
|
+
this.options.auth = credentials;
|
|
18778
|
+
}
|
|
18779
|
+
const options_ = __spreadValues$q({
|
|
18780
|
+
headers: this.getAuthorizationHeaders(credentials)
|
|
18781
|
+
}, options);
|
|
18782
|
+
return this.makeQuery(
|
|
18783
|
+
"/api/component/auth/current_user",
|
|
18784
|
+
{},
|
|
18785
|
+
options_
|
|
18786
|
+
);
|
|
18787
|
+
});
|
|
19055
18788
|
}
|
|
19056
18789
|
/**
|
|
19057
18790
|
* Obtaining the required Headers for authentication of requests in the NGW.
|
|
@@ -19060,7 +18793,7 @@ class NgwConnector {
|
|
|
19060
18793
|
const client = this.makeClientId(credentials);
|
|
19061
18794
|
if (client) {
|
|
19062
18795
|
return {
|
|
19063
|
-
Authorization:
|
|
18796
|
+
Authorization: `Basic ${client}`
|
|
19064
18797
|
};
|
|
19065
18798
|
}
|
|
19066
18799
|
}
|
|
@@ -19068,21 +18801,22 @@ class NgwConnector {
|
|
|
19068
18801
|
credentials = credentials || this.options.auth;
|
|
19069
18802
|
if (credentials) {
|
|
19070
18803
|
const { login, password } = credentials;
|
|
19071
|
-
const str =
|
|
18804
|
+
const str = `${login}:${password}`;
|
|
18805
|
+
const encodedStr = encodeURIComponent(str);
|
|
19072
18806
|
{
|
|
19073
|
-
return window.btoa(
|
|
18807
|
+
return window.btoa(encodedStr);
|
|
19074
18808
|
}
|
|
19075
18809
|
}
|
|
19076
18810
|
}
|
|
19077
18811
|
/** Stop all api requests */
|
|
19078
18812
|
abort() {
|
|
19079
|
-
for (const
|
|
19080
|
-
|
|
18813
|
+
for (const abortController of Object.values(this.activeRequests)) {
|
|
18814
|
+
abortController.abort();
|
|
19081
18815
|
}
|
|
19082
|
-
this.activeRequests =
|
|
18816
|
+
this.activeRequests = {};
|
|
19083
18817
|
}
|
|
19084
18818
|
getActiveApiRequests() {
|
|
19085
|
-
return
|
|
18819
|
+
return __spreadValues$q({}, this.activeRequests);
|
|
19086
18820
|
}
|
|
19087
18821
|
/**
|
|
19088
18822
|
* Send request to NGW api router.
|
|
@@ -19114,23 +18848,10 @@ class NgwConnector {
|
|
|
19114
18848
|
* ```
|
|
19115
18849
|
*/
|
|
19116
18850
|
apiRequest(name, params_ = {}, requestOptions = {}) {
|
|
19117
|
-
var _a
|
|
19118
|
-
const { method, headers, withCredentials, responseType } = requestOptions;
|
|
18851
|
+
var _a;
|
|
19119
18852
|
params_ = (_a = requestOptions.params) != null ? _a : params_;
|
|
19120
|
-
const params = objectRemoveEmpty(params_);
|
|
19121
|
-
|
|
19122
|
-
if (requestOptions.cache && method === "GET") {
|
|
19123
|
-
return this.cache.add(name, makeApiRequest, __spreadValues$p({
|
|
19124
|
-
params
|
|
19125
|
-
}, objectRemoveEmpty({
|
|
19126
|
-
headers,
|
|
19127
|
-
withCredentials,
|
|
19128
|
-
responseType,
|
|
19129
|
-
baseUrl: this.options.baseUrl,
|
|
19130
|
-
userId: (_b = this.user) == null ? void 0 : _b.id
|
|
19131
|
-
})));
|
|
19132
|
-
}
|
|
19133
|
-
return makeApiRequest();
|
|
18853
|
+
const params = objectRemoveEmpty(params_);
|
|
18854
|
+
return apiRequest({ name, params, requestOptions, connector: this });
|
|
19134
18855
|
}
|
|
19135
18856
|
/**
|
|
19136
18857
|
* Shortcut method for send POST request to NGW.
|
|
@@ -19220,17 +18941,67 @@ class NgwConnector {
|
|
|
19220
18941
|
* @param params - Query params
|
|
19221
18942
|
* @param options - Request options
|
|
19222
18943
|
*/
|
|
19223
|
-
makeQuery(
|
|
19224
|
-
|
|
19225
|
-
|
|
18944
|
+
makeQuery(_0, _1) {
|
|
18945
|
+
return __async$p(this, arguments, function* (url, params, options = {}) {
|
|
18946
|
+
var _b;
|
|
18947
|
+
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
18948
|
+
if (!url) {
|
|
18949
|
+
throw new Error("Empty `url` not allowed");
|
|
18950
|
+
}
|
|
19226
18951
|
if (params) {
|
|
19227
|
-
|
|
18952
|
+
const _a = params, restParams = __objRest$2(_a, ["paramList"]);
|
|
18953
|
+
url = template(url, restParams);
|
|
19228
18954
|
}
|
|
19229
18955
|
url = encodeURI(fixUrlStr(url));
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
18956
|
+
const {
|
|
18957
|
+
cache,
|
|
18958
|
+
signal: externalSignal,
|
|
18959
|
+
method = "GET",
|
|
18960
|
+
headers,
|
|
18961
|
+
cacheName,
|
|
18962
|
+
cacheProps,
|
|
18963
|
+
responseType,
|
|
18964
|
+
withCredentials
|
|
18965
|
+
} = options;
|
|
18966
|
+
const internalAbortController = new AbortController();
|
|
18967
|
+
const internalSignal = internalAbortController.signal;
|
|
18968
|
+
if (externalSignal) {
|
|
18969
|
+
if (externalSignal.aborted) {
|
|
18970
|
+
throw new AbortError();
|
|
18971
|
+
}
|
|
18972
|
+
externalSignal.addEventListener("abort", () => {
|
|
18973
|
+
internalAbortController.abort();
|
|
18974
|
+
});
|
|
18975
|
+
}
|
|
18976
|
+
options.signal = internalSignal;
|
|
18977
|
+
const createPromise = () => __async$p(this, null, function* () {
|
|
18978
|
+
const id = REQUEST_ID++;
|
|
18979
|
+
this.activeRequests[id] = internalAbortController;
|
|
18980
|
+
try {
|
|
18981
|
+
return this._loadData(url, options);
|
|
18982
|
+
} finally {
|
|
18983
|
+
this._cleanActiveRequest(id);
|
|
18984
|
+
}
|
|
18985
|
+
});
|
|
18986
|
+
if (cache && method === "GET") {
|
|
18987
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$e(__spreadValues$q({}, objectRemoveEmpty({
|
|
18988
|
+
headers,
|
|
18989
|
+
withCredentials,
|
|
18990
|
+
responseType,
|
|
18991
|
+
baseUrl: this.options.baseUrl,
|
|
18992
|
+
userId: (_b = this.user) == null ? void 0 : _b.id
|
|
18993
|
+
})), {
|
|
18994
|
+
params
|
|
18995
|
+
});
|
|
18996
|
+
return this.cache.add(
|
|
18997
|
+
cacheName || url,
|
|
18998
|
+
createPromise,
|
|
18999
|
+
cacheOptions,
|
|
19000
|
+
false
|
|
19001
|
+
);
|
|
19002
|
+
}
|
|
19003
|
+
return createPromise();
|
|
19004
|
+
});
|
|
19234
19005
|
}
|
|
19235
19006
|
// -------------------------------------------------------------------------
|
|
19236
19007
|
// Resource Methods
|
|
@@ -19312,26 +19083,29 @@ class NgwConnector {
|
|
|
19312
19083
|
*/
|
|
19313
19084
|
_loadData(url, options) {
|
|
19314
19085
|
options.responseType = options.responseType || "json";
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
}
|
|
19318
|
-
const request = new CancelablePromise((resolve, reject, onCancel) => {
|
|
19086
|
+
return new Promise((resolve, reject) => {
|
|
19087
|
+
var _a;
|
|
19319
19088
|
if (this.user) {
|
|
19320
19089
|
options = options || {};
|
|
19321
|
-
options.headers = __spreadValues$
|
|
19090
|
+
options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
|
|
19322
19091
|
}
|
|
19323
19092
|
if (this.requestTransform) {
|
|
19324
19093
|
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
19325
19094
|
url = transUrl;
|
|
19326
19095
|
options = transOptions;
|
|
19327
19096
|
}
|
|
19328
|
-
|
|
19329
|
-
|
|
19330
|
-
|
|
19331
|
-
|
|
19097
|
+
let runOnAbort = void 0;
|
|
19098
|
+
loadData(url, resolve, options, reject, (handler) => {
|
|
19099
|
+
runOnAbort = handler;
|
|
19100
|
+
});
|
|
19101
|
+
(_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
|
|
19102
|
+
if (runOnAbort !== void 0) {
|
|
19103
|
+
runOnAbort();
|
|
19104
|
+
}
|
|
19105
|
+
reject(new AbortError());
|
|
19106
|
+
});
|
|
19332
19107
|
}).catch((httpError) => {
|
|
19333
|
-
|
|
19334
|
-
if (httpError instanceof CancelablePromise.CancelError) ; else {
|
|
19108
|
+
if (httpError.name !== "AbortError") {
|
|
19335
19109
|
{
|
|
19336
19110
|
console.warn("DEV WARN", httpError);
|
|
19337
19111
|
}
|
|
@@ -19340,31 +19114,24 @@ class NgwConnector {
|
|
|
19340
19114
|
throw er;
|
|
19341
19115
|
}
|
|
19342
19116
|
}
|
|
19117
|
+
throw httpError;
|
|
19343
19118
|
});
|
|
19344
|
-
if (options.signal && typeof options.signal.addEventListener === "function") {
|
|
19345
|
-
options.signal.addEventListener("abort", () => {
|
|
19346
|
-
request.cancel();
|
|
19347
|
-
this._cleanActiveRequests(request);
|
|
19348
|
-
});
|
|
19349
|
-
}
|
|
19350
|
-
this.activeRequests.push(request);
|
|
19351
|
-
return request;
|
|
19352
19119
|
}
|
|
19353
19120
|
_login(credentials, options) {
|
|
19354
|
-
return this
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19121
|
+
return __async$p(this, null, function* () {
|
|
19122
|
+
try {
|
|
19123
|
+
const data = yield this.getUserInfo(credentials, options);
|
|
19124
|
+
this.user = data;
|
|
19125
|
+
this.emitter.emit("login", data);
|
|
19126
|
+
return data;
|
|
19127
|
+
} catch (er) {
|
|
19128
|
+
this.emitter.emit("login:error", er);
|
|
19129
|
+
throw er;
|
|
19130
|
+
}
|
|
19361
19131
|
});
|
|
19362
19132
|
}
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
if (activeRequestIndex !== -1) {
|
|
19366
|
-
this.activeRequests.splice(activeRequestIndex, 1);
|
|
19367
|
-
}
|
|
19133
|
+
_cleanActiveRequest(requestId) {
|
|
19134
|
+
delete this.activeRequests[requestId];
|
|
19368
19135
|
}
|
|
19369
19136
|
_handleHttpError(er) {
|
|
19370
19137
|
if (er) {
|
|
@@ -19387,22 +19154,42 @@ __publicField$p(NgwConnector, "errors", {
|
|
|
19387
19154
|
var __defProp$z = Object.defineProperty;
|
|
19388
19155
|
var __defProps$d = Object.defineProperties;
|
|
19389
19156
|
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
19390
|
-
var __getOwnPropSymbols$
|
|
19391
|
-
var __hasOwnProp$
|
|
19392
|
-
var __propIsEnum$
|
|
19157
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
19158
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
19159
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
19393
19160
|
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19394
|
-
var __spreadValues$
|
|
19161
|
+
var __spreadValues$p = (a, b) => {
|
|
19395
19162
|
for (var prop in b || (b = {}))
|
|
19396
|
-
if (__hasOwnProp$
|
|
19163
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
19397
19164
|
__defNormalProp$z(a, prop, b[prop]);
|
|
19398
|
-
if (__getOwnPropSymbols$
|
|
19399
|
-
for (var prop of __getOwnPropSymbols$
|
|
19400
|
-
if (__propIsEnum$
|
|
19165
|
+
if (__getOwnPropSymbols$q)
|
|
19166
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
19167
|
+
if (__propIsEnum$q.call(b, prop))
|
|
19401
19168
|
__defNormalProp$z(a, prop, b[prop]);
|
|
19402
19169
|
}
|
|
19403
19170
|
return a;
|
|
19404
19171
|
};
|
|
19405
19172
|
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
19173
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
19174
|
+
return new Promise((resolve, reject) => {
|
|
19175
|
+
var fulfilled = (value) => {
|
|
19176
|
+
try {
|
|
19177
|
+
step(generator.next(value));
|
|
19178
|
+
} catch (e) {
|
|
19179
|
+
reject(e);
|
|
19180
|
+
}
|
|
19181
|
+
};
|
|
19182
|
+
var rejected = (value) => {
|
|
19183
|
+
try {
|
|
19184
|
+
step(generator.throw(value));
|
|
19185
|
+
} catch (e) {
|
|
19186
|
+
reject(e);
|
|
19187
|
+
}
|
|
19188
|
+
};
|
|
19189
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19190
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19191
|
+
});
|
|
19192
|
+
};
|
|
19406
19193
|
const FEATURE_REQUEST_PARAMS = {
|
|
19407
19194
|
srs: 4326,
|
|
19408
19195
|
geom_format: "geojson"
|
|
@@ -19443,10 +19230,9 @@ function updateItemRequestParam(params, options) {
|
|
|
19443
19230
|
}
|
|
19444
19231
|
}
|
|
19445
19232
|
function createFeatureFieldFilterQueries(opt) {
|
|
19446
|
-
|
|
19447
|
-
opt
|
|
19448
|
-
|
|
19449
|
-
return CancelablePromise.all(queries).then((itemsParts) => {
|
|
19233
|
+
return __async$o(this, null, function* () {
|
|
19234
|
+
const queries = getQueries(opt);
|
|
19235
|
+
const itemsParts = yield Promise.all(queries);
|
|
19450
19236
|
const ids = [];
|
|
19451
19237
|
const items = [];
|
|
19452
19238
|
for (const part of itemsParts) {
|
|
@@ -19479,20 +19265,22 @@ function createParam(pf) {
|
|
|
19479
19265
|
return [`${isFldStr}${field_}__${operation}`, v];
|
|
19480
19266
|
}
|
|
19481
19267
|
function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
19268
|
+
var _a;
|
|
19482
19269
|
const { filters } = opt;
|
|
19270
|
+
const paramList = (_a = opt.paramList) != null ? _a : [];
|
|
19483
19271
|
const logic = typeof filters[0] === "string" ? filters[0] : "all";
|
|
19484
19272
|
const filters_ = filters.filter((x) => Array.isArray(x));
|
|
19485
19273
|
if (logic === "any") {
|
|
19486
19274
|
for (const f of filters_) {
|
|
19487
19275
|
if (isPropertyFilter(f)) {
|
|
19488
19276
|
_queries.push(
|
|
19489
|
-
fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$
|
|
19490
|
-
paramList: [..._parentAllParams, createParam(f)]
|
|
19277
|
+
fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
|
|
19278
|
+
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
19491
19279
|
}))
|
|
19492
19280
|
);
|
|
19493
19281
|
} else {
|
|
19494
19282
|
getQueries(
|
|
19495
|
-
__spreadProps$d(__spreadValues$
|
|
19283
|
+
__spreadProps$d(__spreadValues$p({}, opt), {
|
|
19496
19284
|
filters: f
|
|
19497
19285
|
}),
|
|
19498
19286
|
_queries,
|
|
@@ -19513,7 +19301,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
19513
19301
|
if (propertiesFilterList.length) {
|
|
19514
19302
|
for (const x of propertiesFilterList) {
|
|
19515
19303
|
getQueries(
|
|
19516
|
-
__spreadProps$d(__spreadValues$
|
|
19304
|
+
__spreadProps$d(__spreadValues$p({}, opt), {
|
|
19517
19305
|
filters: x
|
|
19518
19306
|
}),
|
|
19519
19307
|
_queries,
|
|
@@ -19522,8 +19310,8 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
|
|
|
19522
19310
|
}
|
|
19523
19311
|
} else {
|
|
19524
19312
|
_queries.push(
|
|
19525
|
-
fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$
|
|
19526
|
-
paramList: [..._parentAllParams, ...filters2]
|
|
19313
|
+
fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
|
|
19314
|
+
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
19527
19315
|
}))
|
|
19528
19316
|
);
|
|
19529
19317
|
}
|
|
@@ -19538,7 +19326,7 @@ function createWktFromCoordArray(coord) {
|
|
|
19538
19326
|
return `POLYGON((${polygon.join(", ")}))`;
|
|
19539
19327
|
}
|
|
19540
19328
|
function fetchNgwLayerItemsRequest(options) {
|
|
19541
|
-
const params = __spreadValues$
|
|
19329
|
+
const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
|
|
19542
19330
|
const {
|
|
19543
19331
|
limit,
|
|
19544
19332
|
cache,
|
|
@@ -19577,7 +19365,7 @@ function fetchNgwLayerItemsRequest(options) {
|
|
|
19577
19365
|
if (paramList) {
|
|
19578
19366
|
params.paramList = paramList;
|
|
19579
19367
|
}
|
|
19580
|
-
const reqParams = __spreadValues$
|
|
19368
|
+
const reqParams = __spreadValues$p({
|
|
19581
19369
|
id: resourceId
|
|
19582
19370
|
}, params);
|
|
19583
19371
|
return connector.get(
|
|
@@ -19590,52 +19378,90 @@ function fetchNgwLayerItemsRequest(options) {
|
|
|
19590
19378
|
var __defProp$y = Object.defineProperty;
|
|
19591
19379
|
var __defProps$c = Object.defineProperties;
|
|
19592
19380
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
19593
|
-
var __getOwnPropSymbols$
|
|
19594
|
-
var __hasOwnProp$
|
|
19595
|
-
var __propIsEnum$
|
|
19381
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
19382
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
19383
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
19596
19384
|
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19597
|
-
var __spreadValues$
|
|
19385
|
+
var __spreadValues$o = (a, b) => {
|
|
19598
19386
|
for (var prop in b || (b = {}))
|
|
19599
|
-
if (__hasOwnProp$
|
|
19387
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
19600
19388
|
__defNormalProp$y(a, prop, b[prop]);
|
|
19601
|
-
if (__getOwnPropSymbols$
|
|
19602
|
-
for (var prop of __getOwnPropSymbols$
|
|
19603
|
-
if (__propIsEnum$
|
|
19389
|
+
if (__getOwnPropSymbols$p)
|
|
19390
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
19391
|
+
if (__propIsEnum$p.call(b, prop))
|
|
19604
19392
|
__defNormalProp$y(a, prop, b[prop]);
|
|
19605
19393
|
}
|
|
19606
19394
|
return a;
|
|
19607
19395
|
};
|
|
19608
19396
|
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
19397
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
19398
|
+
return new Promise((resolve, reject) => {
|
|
19399
|
+
var fulfilled = (value) => {
|
|
19400
|
+
try {
|
|
19401
|
+
step(generator.next(value));
|
|
19402
|
+
} catch (e) {
|
|
19403
|
+
reject(e);
|
|
19404
|
+
}
|
|
19405
|
+
};
|
|
19406
|
+
var rejected = (value) => {
|
|
19407
|
+
try {
|
|
19408
|
+
step(generator.throw(value));
|
|
19409
|
+
} catch (e) {
|
|
19410
|
+
reject(e);
|
|
19411
|
+
}
|
|
19412
|
+
};
|
|
19413
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19414
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19415
|
+
});
|
|
19416
|
+
};
|
|
19609
19417
|
function fetchNgwLayerItem(options) {
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19418
|
+
return __async$n(this, null, function* () {
|
|
19419
|
+
const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
|
|
19420
|
+
updateItemRequestParam(params, options);
|
|
19421
|
+
const queryParams = __spreadValues$o({
|
|
19422
|
+
id: options.resourceId,
|
|
19423
|
+
fid: options.featureId
|
|
19424
|
+
}, params);
|
|
19425
|
+
const resp = yield options.connector.get(
|
|
19426
|
+
"feature_layer.feature.item",
|
|
19427
|
+
options,
|
|
19428
|
+
queryParams
|
|
19429
|
+
);
|
|
19430
|
+
const toGeojson = () => __async$n(this, null, function* () {
|
|
19431
|
+
if (resp.geom) {
|
|
19432
|
+
return createGeoJsonFeature(resp);
|
|
19433
|
+
} else {
|
|
19434
|
+
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$c(__spreadValues$o({}, options), {
|
|
19435
|
+
geom: true,
|
|
19436
|
+
fields: null,
|
|
19437
|
+
extensions: null
|
|
19438
|
+
}));
|
|
19439
|
+
const geom = onlyGeomItem.geom;
|
|
19440
|
+
return createGeoJsonFeature(__spreadProps$c(__spreadValues$o({}, resp), { geom }));
|
|
19632
19441
|
}
|
|
19633
19442
|
});
|
|
19443
|
+
return __spreadProps$c(__spreadValues$o({}, resp), {
|
|
19444
|
+
toGeojson
|
|
19445
|
+
});
|
|
19634
19446
|
});
|
|
19635
19447
|
}
|
|
19636
19448
|
|
|
19637
19449
|
var __defProp$x = Object.defineProperty;
|
|
19450
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
19451
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
19452
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
19638
19453
|
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19454
|
+
var __spreadValues$n = (a, b) => {
|
|
19455
|
+
for (var prop in b || (b = {}))
|
|
19456
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
19457
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
19458
|
+
if (__getOwnPropSymbols$o)
|
|
19459
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
19460
|
+
if (__propIsEnum$o.call(b, prop))
|
|
19461
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
19462
|
+
}
|
|
19463
|
+
return a;
|
|
19464
|
+
};
|
|
19639
19465
|
var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19640
19466
|
class BookmarkItem {
|
|
19641
19467
|
constructor(options) {
|
|
@@ -19653,11 +19479,11 @@ class BookmarkItem {
|
|
|
19653
19479
|
this.name = String(item.id);
|
|
19654
19480
|
}
|
|
19655
19481
|
}
|
|
19656
|
-
extent() {
|
|
19482
|
+
extent(opt) {
|
|
19657
19483
|
if (this._extent) {
|
|
19658
|
-
return
|
|
19484
|
+
return Promise.resolve(this._extent);
|
|
19659
19485
|
}
|
|
19660
|
-
return this.options.connector.get("feature_layer.feature.item_extent",
|
|
19486
|
+
return this.options.connector.get("feature_layer.feature.item_extent", opt, {
|
|
19661
19487
|
id: this.resourceId,
|
|
19662
19488
|
fid: this.item.id
|
|
19663
19489
|
}).then((resp) => {
|
|
@@ -19667,18 +19493,18 @@ class BookmarkItem {
|
|
|
19667
19493
|
return lonLat;
|
|
19668
19494
|
});
|
|
19669
19495
|
}
|
|
19670
|
-
geoJson() {
|
|
19496
|
+
geoJson(opt) {
|
|
19671
19497
|
if (this.item.geom) {
|
|
19672
|
-
return
|
|
19498
|
+
return Promise.resolve(createGeoJsonFeature(this.item));
|
|
19673
19499
|
} else {
|
|
19674
|
-
return fetchNgwLayerItem({
|
|
19500
|
+
return fetchNgwLayerItem(__spreadValues$n({
|
|
19675
19501
|
resourceId: this.resourceId,
|
|
19676
19502
|
featureId: this.item.id,
|
|
19677
19503
|
connector: this.options.connector,
|
|
19678
19504
|
geom: true,
|
|
19679
19505
|
fields: null,
|
|
19680
19506
|
extensions: null
|
|
19681
|
-
}).then((onlyGeomItem) => {
|
|
19507
|
+
}, opt)).then((onlyGeomItem) => {
|
|
19682
19508
|
const geom = onlyGeomItem.geom;
|
|
19683
19509
|
this.item.geom = geom;
|
|
19684
19510
|
return createGeoJsonFeature(this.item);
|
|
@@ -19688,22 +19514,20 @@ class BookmarkItem {
|
|
|
19688
19514
|
}
|
|
19689
19515
|
|
|
19690
19516
|
function treeEvery(item, filter, relation, itemPrepare) {
|
|
19691
|
-
return !!treeWrapper(item, filter, relation, treeEvery_
|
|
19517
|
+
return !!treeWrapper(item, filter, relation, treeEvery_);
|
|
19692
19518
|
}
|
|
19693
19519
|
function treeSome(item, filter, relation, itemPrepare) {
|
|
19694
|
-
return !!treeWrapper(item, filter, relation, treeFind_
|
|
19520
|
+
return !!treeWrapper(item, filter, relation, treeFind_);
|
|
19695
19521
|
}
|
|
19696
19522
|
function treeFind(item, filter, relation, itemPrepare) {
|
|
19697
|
-
return treeWrapper(item, filter, relation, treeFind_
|
|
19523
|
+
return treeWrapper(item, filter, relation, treeFind_);
|
|
19698
19524
|
}
|
|
19699
19525
|
function treeFilter(item, filter, relation, itemPrepare) {
|
|
19700
19526
|
return treeWrapper(
|
|
19701
19527
|
item,
|
|
19702
19528
|
filter,
|
|
19703
19529
|
relation,
|
|
19704
|
-
treeFilter_
|
|
19705
|
-
itemPrepare
|
|
19706
|
-
);
|
|
19530
|
+
treeFilter_);
|
|
19707
19531
|
}
|
|
19708
19532
|
function getChildren(item, relation = "children") {
|
|
19709
19533
|
let children = [];
|
|
@@ -19720,13 +19544,6 @@ function getChildren(item, relation = "children") {
|
|
|
19720
19544
|
}
|
|
19721
19545
|
function treeWrapper(item, filter = (x) => !!x, relation = "children", treeFunction, itemPrepare) {
|
|
19722
19546
|
const filterFunction = typeof filter === "function" ? filter : (i) => propertiesFilter(i, filter);
|
|
19723
|
-
if (itemPrepare) {
|
|
19724
|
-
return treeFunction(
|
|
19725
|
-
item,
|
|
19726
|
-
(i) => filterFunction(itemPrepare(i)),
|
|
19727
|
-
relation
|
|
19728
|
-
);
|
|
19729
|
-
}
|
|
19730
19547
|
return treeFunction(item, filterFunction, relation);
|
|
19731
19548
|
}
|
|
19732
19549
|
function treeFind_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
|
|
@@ -19993,7 +19810,7 @@ var __spreadValues$m = (a, b) => {
|
|
|
19993
19810
|
}
|
|
19994
19811
|
return a;
|
|
19995
19812
|
};
|
|
19996
|
-
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj,
|
|
19813
|
+
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, key + "" , value);
|
|
19997
19814
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
19998
19815
|
constructor(name, item, options) {
|
|
19999
19816
|
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
@@ -20317,9 +20134,10 @@ function getNgwWebmapExtent(webmap) {
|
|
|
20317
20134
|
function fetchNgwLayerExtent({
|
|
20318
20135
|
resourceId,
|
|
20319
20136
|
connector,
|
|
20320
|
-
cache = true
|
|
20137
|
+
cache = true,
|
|
20138
|
+
signal
|
|
20321
20139
|
}) {
|
|
20322
|
-
return connector.get("layer.extent", { cache }, { id: resourceId }).then((resp) => {
|
|
20140
|
+
return connector.get("layer.extent", { cache, signal }, { id: resourceId }).then((resp) => {
|
|
20323
20141
|
if (resp) {
|
|
20324
20142
|
const { maxLat, maxLon, minLat, minLon } = resp.extent;
|
|
20325
20143
|
const extentArray = [minLon, minLat, maxLon, maxLat];
|
|
@@ -20331,11 +20149,12 @@ function fetchNgwLayerItemExtent({
|
|
|
20331
20149
|
resourceId,
|
|
20332
20150
|
featureId,
|
|
20333
20151
|
connector,
|
|
20334
|
-
cache = true
|
|
20152
|
+
cache = true,
|
|
20153
|
+
signal
|
|
20335
20154
|
}) {
|
|
20336
20155
|
return connector.get(
|
|
20337
20156
|
"feature_layer.feature.item_extent",
|
|
20338
|
-
{ cache },
|
|
20157
|
+
{ cache, signal },
|
|
20339
20158
|
{ id: resourceId, fid: featureId }
|
|
20340
20159
|
).then((resp) => {
|
|
20341
20160
|
if (resp) {
|
|
@@ -20346,7 +20165,10 @@ function fetchNgwLayerItemExtent({
|
|
|
20346
20165
|
});
|
|
20347
20166
|
}
|
|
20348
20167
|
function fetchNgwExtent(options) {
|
|
20349
|
-
return options.connector.getResource(options.resourceId
|
|
20168
|
+
return options.connector.getResource(options.resourceId, {
|
|
20169
|
+
signal: options.signal,
|
|
20170
|
+
cache: options.cache
|
|
20171
|
+
}).then((resource) => {
|
|
20350
20172
|
if (resource) {
|
|
20351
20173
|
return fetchNgwResourceExtent(resource, options.connector, options);
|
|
20352
20174
|
}
|
|
@@ -20354,11 +20176,11 @@ function fetchNgwExtent(options) {
|
|
|
20354
20176
|
}
|
|
20355
20177
|
function fetchNgwResourceExtent(item, connector, options) {
|
|
20356
20178
|
if (item.webmap) {
|
|
20357
|
-
return
|
|
20179
|
+
return Promise.resolve(getNgwWebmapExtent(item.webmap));
|
|
20358
20180
|
} else {
|
|
20359
20181
|
const resource = item.resource;
|
|
20360
20182
|
if (resource.cls && resource.cls.indexOf("style") !== -1) {
|
|
20361
|
-
return connector.getResource(resource.parent.id).then((res) => {
|
|
20183
|
+
return connector.getResource(resource.parent.id, options).then((res) => {
|
|
20362
20184
|
if (res) {
|
|
20363
20185
|
return fetchNgwLayerExtent(__spreadProps$b(__spreadValues$j({}, options), {
|
|
20364
20186
|
resourceId: res.resource.id,
|
|
@@ -20378,7 +20200,7 @@ function fetchNgwResourceExtent(item, connector, options) {
|
|
|
20378
20200
|
var __defProp$q = Object.defineProperty;
|
|
20379
20201
|
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20380
20202
|
var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20381
|
-
var __async$
|
|
20203
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
20382
20204
|
return new Promise((resolve, reject) => {
|
|
20383
20205
|
var fulfilled = (value) => {
|
|
20384
20206
|
try {
|
|
@@ -20406,12 +20228,12 @@ class NgwResource {
|
|
|
20406
20228
|
}
|
|
20407
20229
|
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
20408
20230
|
getExtent() {
|
|
20409
|
-
return __async$
|
|
20231
|
+
return __async$m(this, null, function* () {
|
|
20410
20232
|
return this.getBounds();
|
|
20411
20233
|
});
|
|
20412
20234
|
}
|
|
20413
20235
|
getBounds(options) {
|
|
20414
|
-
return __async$
|
|
20236
|
+
return __async$m(this, null, function* () {
|
|
20415
20237
|
if (this._extent) {
|
|
20416
20238
|
return this._extent;
|
|
20417
20239
|
}
|
|
@@ -20427,7 +20249,7 @@ class NgwResource {
|
|
|
20427
20249
|
}
|
|
20428
20250
|
}
|
|
20429
20251
|
|
|
20430
|
-
var __async$
|
|
20252
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
20431
20253
|
return new Promise((resolve, reject) => {
|
|
20432
20254
|
var fulfilled = (value) => {
|
|
20433
20255
|
try {
|
|
@@ -20448,7 +20270,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
20448
20270
|
});
|
|
20449
20271
|
};
|
|
20450
20272
|
function resourceIdFromLayerOptions(options, connector) {
|
|
20451
|
-
return __async$
|
|
20273
|
+
return __async$l(this, null, function* () {
|
|
20452
20274
|
const resource = options.resource;
|
|
20453
20275
|
const item = resource;
|
|
20454
20276
|
let { keyname, resourceId } = options;
|
|
@@ -20550,7 +20372,7 @@ var __objRest$1 = (source, exclude) => {
|
|
|
20550
20372
|
return target;
|
|
20551
20373
|
};
|
|
20552
20374
|
var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20553
|
-
var __async$
|
|
20375
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
20554
20376
|
return new Promise((resolve, reject) => {
|
|
20555
20377
|
var fulfilled = (value) => {
|
|
20556
20378
|
try {
|
|
@@ -20602,7 +20424,7 @@ function createQmsAdapter(webMapOrOptions, url = URL, createOpt = {}) {
|
|
|
20602
20424
|
}
|
|
20603
20425
|
}
|
|
20604
20426
|
addLayer(options) {
|
|
20605
|
-
return __async$
|
|
20427
|
+
return __async$k(this, null, function* () {
|
|
20606
20428
|
if (!this.qms && options.qmsId) {
|
|
20607
20429
|
try {
|
|
20608
20430
|
this.qms = yield loadJson(
|
|
@@ -20710,7 +20532,7 @@ var __spreadValues$g = (a, b) => {
|
|
|
20710
20532
|
};
|
|
20711
20533
|
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
20712
20534
|
var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
|
|
20713
|
-
var __async$
|
|
20535
|
+
var __async$j = (__this, __arguments, generator) => {
|
|
20714
20536
|
return new Promise((resolve, reject) => {
|
|
20715
20537
|
var fulfilled = (value) => {
|
|
20716
20538
|
try {
|
|
@@ -20731,7 +20553,7 @@ var __async$g = (__this, __arguments, generator) => {
|
|
|
20731
20553
|
});
|
|
20732
20554
|
};
|
|
20733
20555
|
function createBasemapLayerAdapter(_0) {
|
|
20734
|
-
return __async$
|
|
20556
|
+
return __async$j(this, arguments, function* ({
|
|
20735
20557
|
webMap,
|
|
20736
20558
|
item
|
|
20737
20559
|
}) {
|
|
@@ -20752,7 +20574,7 @@ function createBasemapLayerAdapter(_0) {
|
|
|
20752
20574
|
if (TileAdapter) {
|
|
20753
20575
|
class BasemapTileAdapter extends TileAdapter {
|
|
20754
20576
|
addLayer(opt) {
|
|
20755
|
-
return __async$
|
|
20577
|
+
return __async$j(this, null, function* () {
|
|
20756
20578
|
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$a(__spreadValues$g({}, opt), { url }));
|
|
20757
20579
|
});
|
|
20758
20580
|
}
|
|
@@ -20792,11 +20614,12 @@ function createPopupContent(feature, item) {
|
|
|
20792
20614
|
function fetchNgwLayerCount({
|
|
20793
20615
|
connector,
|
|
20794
20616
|
resourceId,
|
|
20795
|
-
cache = true
|
|
20617
|
+
cache = true,
|
|
20618
|
+
signal
|
|
20796
20619
|
}) {
|
|
20797
20620
|
return connector.get(
|
|
20798
20621
|
"feature_layer.feature.count",
|
|
20799
|
-
{ cache },
|
|
20622
|
+
{ cache, signal },
|
|
20800
20623
|
{
|
|
20801
20624
|
id: resourceId
|
|
20802
20625
|
}
|
|
@@ -20850,13 +20673,34 @@ var __spreadValues$f = (a, b) => {
|
|
|
20850
20673
|
return a;
|
|
20851
20674
|
};
|
|
20852
20675
|
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
20676
|
+
var __async$i = (__this, __arguments, generator) => {
|
|
20677
|
+
return new Promise((resolve, reject) => {
|
|
20678
|
+
var fulfilled = (value) => {
|
|
20679
|
+
try {
|
|
20680
|
+
step(generator.next(value));
|
|
20681
|
+
} catch (e) {
|
|
20682
|
+
reject(e);
|
|
20683
|
+
}
|
|
20684
|
+
};
|
|
20685
|
+
var rejected = (value) => {
|
|
20686
|
+
try {
|
|
20687
|
+
step(generator.throw(value));
|
|
20688
|
+
} catch (e) {
|
|
20689
|
+
reject(e);
|
|
20690
|
+
}
|
|
20691
|
+
};
|
|
20692
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
20693
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20694
|
+
});
|
|
20695
|
+
};
|
|
20853
20696
|
function fetchNgwLayerItems(options) {
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20697
|
+
return __async$i(this, null, function* () {
|
|
20698
|
+
var _a;
|
|
20699
|
+
const filters = options.filters;
|
|
20700
|
+
if (filters) {
|
|
20701
|
+
let data = yield createFeatureFieldFilterQueries(__spreadProps$9(__spreadValues$f({}, options), {
|
|
20702
|
+
filters
|
|
20703
|
+
}));
|
|
20860
20704
|
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
|
|
20861
20705
|
if (clientFilterValidate) {
|
|
20862
20706
|
data = data.filter((y) => {
|
|
@@ -20868,10 +20712,10 @@ function fetchNgwLayerItems(options) {
|
|
|
20868
20712
|
});
|
|
20869
20713
|
}
|
|
20870
20714
|
return data;
|
|
20871
|
-
}
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
}
|
|
20715
|
+
} else {
|
|
20716
|
+
return fetchNgwLayerItemsRequest(options);
|
|
20717
|
+
}
|
|
20718
|
+
});
|
|
20875
20719
|
}
|
|
20876
20720
|
function isFilterWithAnyCase(filters) {
|
|
20877
20721
|
if (filters[0] === "any") {
|
|
@@ -20889,8 +20733,29 @@ function isFilterWithAnyCase(filters) {
|
|
|
20889
20733
|
return false;
|
|
20890
20734
|
}
|
|
20891
20735
|
|
|
20736
|
+
var __async$h = (__this, __arguments, generator) => {
|
|
20737
|
+
return new Promise((resolve, reject) => {
|
|
20738
|
+
var fulfilled = (value) => {
|
|
20739
|
+
try {
|
|
20740
|
+
step(generator.next(value));
|
|
20741
|
+
} catch (e) {
|
|
20742
|
+
reject(e);
|
|
20743
|
+
}
|
|
20744
|
+
};
|
|
20745
|
+
var rejected = (value) => {
|
|
20746
|
+
try {
|
|
20747
|
+
step(generator.throw(value));
|
|
20748
|
+
} catch (e) {
|
|
20749
|
+
reject(e);
|
|
20750
|
+
}
|
|
20751
|
+
};
|
|
20752
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
20753
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20754
|
+
});
|
|
20755
|
+
};
|
|
20892
20756
|
function fetchNgwLayerFeatures(options) {
|
|
20893
|
-
return
|
|
20757
|
+
return __async$h(this, null, function* () {
|
|
20758
|
+
const x = yield fetchNgwLayerItems(options);
|
|
20894
20759
|
const features = [];
|
|
20895
20760
|
x.forEach((y) => {
|
|
20896
20761
|
features.push(createGeoJsonFeature(y));
|
|
@@ -20950,7 +20815,7 @@ var __spreadValues$e = (a, b) => {
|
|
|
20950
20815
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
20951
20816
|
var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20952
20817
|
var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
|
|
20953
|
-
var __async$
|
|
20818
|
+
var __async$g = (__this, __arguments, generator) => {
|
|
20954
20819
|
return new Promise((resolve, reject) => {
|
|
20955
20820
|
var fulfilled = (value) => {
|
|
20956
20821
|
try {
|
|
@@ -20971,7 +20836,7 @@ var __async$f = (__this, __arguments, generator) => {
|
|
|
20971
20836
|
});
|
|
20972
20837
|
};
|
|
20973
20838
|
function createGeoJsonAdapter(props) {
|
|
20974
|
-
return __async$
|
|
20839
|
+
return __async$g(this, null, function* () {
|
|
20975
20840
|
var _a, _b;
|
|
20976
20841
|
const {
|
|
20977
20842
|
item,
|
|
@@ -20987,29 +20852,35 @@ function createGeoJsonAdapter(props) {
|
|
|
20987
20852
|
const _loadedIds = [];
|
|
20988
20853
|
let _fullDataLoad = false;
|
|
20989
20854
|
let _lastFilterArgs;
|
|
20990
|
-
let
|
|
20855
|
+
let internalAbortController;
|
|
20991
20856
|
const resourceId = yield resourceIdFromLayerOptions(options, connector);
|
|
20992
20857
|
if ((_b = (_a = options.adapterOptions) == null ? void 0 : _a.popupOptions) == null ? void 0 : _b.fromProperties) {
|
|
20993
20858
|
options.adapterOptions.popupOptions.createPopupContent = ({ feature }) => {
|
|
20994
20859
|
return feature && createPopupContent(feature, item);
|
|
20995
20860
|
};
|
|
20996
20861
|
}
|
|
20997
|
-
const getData = (filters, filterOpt) => __async$
|
|
20862
|
+
const getData = (filters, filterOpt) => __async$g(this, null, function* () {
|
|
20998
20863
|
abort();
|
|
20864
|
+
internalAbortController = new AbortController();
|
|
20865
|
+
const internalSignal = internalAbortController.signal;
|
|
20866
|
+
if (filterOpt == null ? void 0 : filterOpt.signal) {
|
|
20867
|
+
filterOpt.signal.addEventListener("abort", internalAbortController.abort);
|
|
20868
|
+
}
|
|
20869
|
+
filterOpt = filterOpt || {};
|
|
20870
|
+
filterOpt.signal = internalSignal;
|
|
20999
20871
|
_lastFilterArgs = { filters, options: filterOpt };
|
|
21000
|
-
|
|
20872
|
+
return fetchNgwLayerFeatureCollection(__spreadValues$e({
|
|
21001
20873
|
resourceId,
|
|
21002
20874
|
filters,
|
|
21003
20875
|
connector,
|
|
21004
20876
|
cache: true
|
|
21005
20877
|
}, filterOpt));
|
|
21006
|
-
return yield _dataPromise;
|
|
21007
20878
|
});
|
|
21008
20879
|
let removed = false;
|
|
21009
20880
|
const abort = () => {
|
|
21010
|
-
if (
|
|
21011
|
-
|
|
21012
|
-
|
|
20881
|
+
if (internalAbortController) {
|
|
20882
|
+
internalAbortController.abort();
|
|
20883
|
+
internalAbortController = void 0;
|
|
21013
20884
|
}
|
|
21014
20885
|
};
|
|
21015
20886
|
class NgwGeoJsonAdapter extends GeoJsonAdapter {
|
|
@@ -21022,7 +20893,7 @@ function createGeoJsonAdapter(props) {
|
|
|
21022
20893
|
__publicField$f(this, "__disableMapMoveListener");
|
|
21023
20894
|
}
|
|
21024
20895
|
addLayer(opt) {
|
|
21025
|
-
return __async$
|
|
20896
|
+
return __async$g(this, null, function* () {
|
|
21026
20897
|
let needUpdate = !opt.data;
|
|
21027
20898
|
const waitFullLoad = opt.waitFullLoad !== void 0 ? opt.waitFullLoad : true;
|
|
21028
20899
|
if (options.id !== void 0) {
|
|
@@ -21067,7 +20938,7 @@ function createGeoJsonAdapter(props) {
|
|
|
21067
20938
|
return this.getBounds();
|
|
21068
20939
|
}
|
|
21069
20940
|
getBounds() {
|
|
21070
|
-
return __async$
|
|
20941
|
+
return __async$g(this, null, function* () {
|
|
21071
20942
|
const hasData = this.getLayers && this.getLayers().length;
|
|
21072
20943
|
const strategy = this.options.strategy;
|
|
21073
20944
|
if ((strategy == null ? void 0 : strategy.startsWith("BBOX")) || hasData) {
|
|
@@ -21093,7 +20964,7 @@ function createGeoJsonAdapter(props) {
|
|
|
21093
20964
|
return fetchNgwLayerCount({ connector, resourceId, cache: true });
|
|
21094
20965
|
}
|
|
21095
20966
|
updateLayer(filterArgs) {
|
|
21096
|
-
return __async$
|
|
20967
|
+
return __async$g(this, null, function* () {
|
|
21097
20968
|
var _a2;
|
|
21098
20969
|
filterArgs = filterArgs || _lastFilterArgs || {};
|
|
21099
20970
|
if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
|
|
@@ -21159,7 +21030,7 @@ function createGeoJsonAdapter(props) {
|
|
|
21159
21030
|
});
|
|
21160
21031
|
}
|
|
21161
21032
|
propertiesFilter(filters, opt) {
|
|
21162
|
-
return __async$
|
|
21033
|
+
return __async$g(this, null, function* () {
|
|
21163
21034
|
abort();
|
|
21164
21035
|
if (this.filter && _fullDataLoad) {
|
|
21165
21036
|
this.filter((e) => {
|
|
@@ -21233,7 +21104,7 @@ function createGeoJsonAdapter(props) {
|
|
|
21233
21104
|
});
|
|
21234
21105
|
}
|
|
21235
21106
|
|
|
21236
|
-
var __async$
|
|
21107
|
+
var __async$f = (__this, __arguments, generator) => {
|
|
21237
21108
|
return new Promise((resolve, reject) => {
|
|
21238
21109
|
var fulfilled = (value) => {
|
|
21239
21110
|
try {
|
|
@@ -21254,7 +21125,7 @@ var __async$e = (__this, __arguments, generator) => {
|
|
|
21254
21125
|
});
|
|
21255
21126
|
};
|
|
21256
21127
|
function createWebMapAdapter(_0) {
|
|
21257
|
-
return __async$
|
|
21128
|
+
return __async$f(this, arguments, function* ({
|
|
21258
21129
|
layerOptions: options,
|
|
21259
21130
|
webMap,
|
|
21260
21131
|
connector
|
|
@@ -21382,7 +21253,7 @@ var __spreadValues$d = (a, b) => {
|
|
|
21382
21253
|
};
|
|
21383
21254
|
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
21384
21255
|
var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21385
|
-
var __async$
|
|
21256
|
+
var __async$e = (__this, __arguments, generator) => {
|
|
21386
21257
|
return new Promise((resolve, reject) => {
|
|
21387
21258
|
var fulfilled = (value) => {
|
|
21388
21259
|
try {
|
|
@@ -21403,7 +21274,7 @@ var __async$d = (__this, __arguments, generator) => {
|
|
|
21403
21274
|
});
|
|
21404
21275
|
};
|
|
21405
21276
|
function createRasterAdapter(_0) {
|
|
21406
|
-
return __async$
|
|
21277
|
+
return __async$e(this, arguments, function* ({
|
|
21407
21278
|
layerOptions,
|
|
21408
21279
|
webMap,
|
|
21409
21280
|
connector,
|
|
@@ -21459,7 +21330,7 @@ function createRasterAdapter(_0) {
|
|
|
21459
21330
|
return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
|
|
21460
21331
|
}
|
|
21461
21332
|
getLegend(options) {
|
|
21462
|
-
return __async$
|
|
21333
|
+
return __async$e(this, null, function* () {
|
|
21463
21334
|
const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
|
|
21464
21335
|
params: { id: resourceId },
|
|
21465
21336
|
cache: true
|
|
@@ -21479,7 +21350,7 @@ function createRasterAdapter(_0) {
|
|
|
21479
21350
|
});
|
|
21480
21351
|
}
|
|
21481
21352
|
getIdentificationIds() {
|
|
21482
|
-
return __async$
|
|
21353
|
+
return __async$e(this, null, function* () {
|
|
21483
21354
|
if (this.item) {
|
|
21484
21355
|
if (adapter === "MVT") {
|
|
21485
21356
|
return [this.item.resource.id];
|
|
@@ -21520,7 +21391,7 @@ var __spreadValues$c = (a, b) => {
|
|
|
21520
21391
|
return a;
|
|
21521
21392
|
};
|
|
21522
21393
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
21523
|
-
var __async$
|
|
21394
|
+
var __async$d = (__this, __arguments, generator) => {
|
|
21524
21395
|
return new Promise((resolve, reject) => {
|
|
21525
21396
|
var fulfilled = (value) => {
|
|
21526
21397
|
try {
|
|
@@ -21556,7 +21427,7 @@ const supportCls = [
|
|
|
21556
21427
|
"tmsclient_layer"
|
|
21557
21428
|
];
|
|
21558
21429
|
function createAdapterFromFirstStyle(_0) {
|
|
21559
|
-
return __async$
|
|
21430
|
+
return __async$d(this, arguments, function* ({
|
|
21560
21431
|
layerOptions,
|
|
21561
21432
|
webMap,
|
|
21562
21433
|
connector,
|
|
@@ -21575,7 +21446,7 @@ function createAdapterFromFirstStyle(_0) {
|
|
|
21575
21446
|
});
|
|
21576
21447
|
}
|
|
21577
21448
|
function createAsyncAdapter(options, webMap, connector) {
|
|
21578
|
-
return __async$
|
|
21449
|
+
return __async$d(this, null, function* () {
|
|
21579
21450
|
let adapter;
|
|
21580
21451
|
let item;
|
|
21581
21452
|
const adapterType = options.adapter;
|
|
@@ -21772,7 +21643,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
21772
21643
|
return a;
|
|
21773
21644
|
};
|
|
21774
21645
|
var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21775
|
-
var __async$
|
|
21646
|
+
var __async$c = (__this, __arguments, generator) => {
|
|
21776
21647
|
return new Promise((resolve, reject) => {
|
|
21777
21648
|
var fulfilled = (value) => {
|
|
21778
21649
|
try {
|
|
@@ -21822,7 +21693,7 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
21822
21693
|
}
|
|
21823
21694
|
}
|
|
21824
21695
|
static create(webMap, item, options, connector, parent) {
|
|
21825
|
-
return __async$
|
|
21696
|
+
return __async$c(this, null, function* () {
|
|
21826
21697
|
const ngwWebmapItem = new _NgwWebmapItem(
|
|
21827
21698
|
webMap,
|
|
21828
21699
|
item,
|
|
@@ -21851,15 +21722,14 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
|
|
|
21851
21722
|
return this.layer;
|
|
21852
21723
|
}
|
|
21853
21724
|
getLegend(options) {
|
|
21854
|
-
return __async$
|
|
21725
|
+
return __async$c(this, null, function* () {
|
|
21855
21726
|
var _a;
|
|
21856
21727
|
const id = (_a = this.layer) == null ? void 0 : _a.id;
|
|
21857
21728
|
if (id !== void 0) {
|
|
21858
21729
|
const connector = this.connector;
|
|
21859
21730
|
if (connector) {
|
|
21860
21731
|
const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$a({
|
|
21861
|
-
params: { id: this.item.resourceId }
|
|
21862
|
-
cache: true
|
|
21732
|
+
params: { id: this.item.resourceId }
|
|
21863
21733
|
}, options));
|
|
21864
21734
|
const legend = {
|
|
21865
21735
|
layerId: id,
|
|
@@ -22050,7 +21920,7 @@ var __spreadValues$9 = (a, b) => {
|
|
|
22050
21920
|
return a;
|
|
22051
21921
|
};
|
|
22052
21922
|
var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22053
|
-
var __async$
|
|
21923
|
+
var __async$b = (__this, __arguments, generator) => {
|
|
22054
21924
|
return new Promise((resolve, reject) => {
|
|
22055
21925
|
var fulfilled = (value) => {
|
|
22056
21926
|
try {
|
|
@@ -22071,7 +21941,7 @@ var __async$a = (__this, __arguments, generator) => {
|
|
|
22071
21941
|
});
|
|
22072
21942
|
};
|
|
22073
21943
|
function createOnFirstShowAdapter(_0) {
|
|
22074
|
-
return __async$
|
|
21944
|
+
return __async$b(this, arguments, function* ({
|
|
22075
21945
|
webMap,
|
|
22076
21946
|
adapterOptions = {},
|
|
22077
21947
|
onLayerAdded,
|
|
@@ -22097,7 +21967,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
22097
21967
|
return this._removed;
|
|
22098
21968
|
}
|
|
22099
21969
|
showLayer() {
|
|
22100
|
-
return __async$
|
|
21970
|
+
return __async$b(this, null, function* () {
|
|
22101
21971
|
this.options.visibility = true;
|
|
22102
21972
|
if (this.layer.length) {
|
|
22103
21973
|
for (const x of this.layer) {
|
|
@@ -22109,7 +21979,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
22109
21979
|
});
|
|
22110
21980
|
}
|
|
22111
21981
|
hideLayer() {
|
|
22112
|
-
return __async$
|
|
21982
|
+
return __async$b(this, null, function* () {
|
|
22113
21983
|
this.options.visibility = false;
|
|
22114
21984
|
if (this.layer) {
|
|
22115
21985
|
for (const x of this.layer) {
|
|
@@ -22119,7 +21989,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
22119
21989
|
});
|
|
22120
21990
|
}
|
|
22121
21991
|
loadLayer() {
|
|
22122
|
-
return __async$
|
|
21992
|
+
return __async$b(this, null, function* () {
|
|
22123
21993
|
if (!this.layer.length && !this._creatingInProgress) {
|
|
22124
21994
|
this._creatingInProgress = true;
|
|
22125
21995
|
const Adapter = yield createAdapter(this);
|
|
@@ -22153,7 +22023,7 @@ function createOnFirstShowAdapter(_0) {
|
|
|
22153
22023
|
});
|
|
22154
22024
|
}
|
|
22155
22025
|
|
|
22156
|
-
var __async$
|
|
22026
|
+
var __async$a = (__this, __arguments, generator) => {
|
|
22157
22027
|
return new Promise((resolve, reject) => {
|
|
22158
22028
|
var fulfilled = (value) => {
|
|
22159
22029
|
try {
|
|
@@ -22174,7 +22044,7 @@ var __async$9 = (__this, __arguments, generator) => {
|
|
|
22174
22044
|
});
|
|
22175
22045
|
};
|
|
22176
22046
|
function createOnFirstShowNgwAdapter(_0) {
|
|
22177
|
-
return __async$
|
|
22047
|
+
return __async$a(this, arguments, function* ({
|
|
22178
22048
|
webMap,
|
|
22179
22049
|
connector,
|
|
22180
22050
|
item,
|
|
@@ -22227,7 +22097,7 @@ var __spreadValues$8 = (a, b) => {
|
|
|
22227
22097
|
return a;
|
|
22228
22098
|
};
|
|
22229
22099
|
var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22230
|
-
var __async$
|
|
22100
|
+
var __async$9 = (__this, __arguments, generator) => {
|
|
22231
22101
|
return new Promise((resolve, reject) => {
|
|
22232
22102
|
var fulfilled = (value) => {
|
|
22233
22103
|
try {
|
|
@@ -22278,7 +22148,7 @@ class NgwWebmapLayerAdapter {
|
|
|
22278
22148
|
}
|
|
22279
22149
|
}
|
|
22280
22150
|
addLayer(options) {
|
|
22281
|
-
return __async$
|
|
22151
|
+
return __async$9(this, null, function* () {
|
|
22282
22152
|
var _a, _b;
|
|
22283
22153
|
this.options = __spreadValues$8(__spreadValues$8({}, this.options), options);
|
|
22284
22154
|
this.layer = yield this._getWebMapLayerItem();
|
|
@@ -22311,21 +22181,21 @@ class NgwWebmapLayerAdapter {
|
|
|
22311
22181
|
delete this._webmapLayersIds;
|
|
22312
22182
|
}
|
|
22313
22183
|
showLayer() {
|
|
22314
|
-
return __async$
|
|
22184
|
+
return __async$9(this, null, function* () {
|
|
22315
22185
|
if (this.layer && this.layer.properties) {
|
|
22316
22186
|
return this.layer.properties.property("visibility").set(true);
|
|
22317
22187
|
}
|
|
22318
22188
|
});
|
|
22319
22189
|
}
|
|
22320
22190
|
hideLayer() {
|
|
22321
|
-
return __async$
|
|
22191
|
+
return __async$9(this, null, function* () {
|
|
22322
22192
|
if (this.layer && this.layer.properties) {
|
|
22323
22193
|
return this.layer.properties.property("visibility").set(false);
|
|
22324
22194
|
}
|
|
22325
22195
|
});
|
|
22326
22196
|
}
|
|
22327
22197
|
setOpacity(val) {
|
|
22328
|
-
return __async$
|
|
22198
|
+
return __async$9(this, null, function* () {
|
|
22329
22199
|
if (this.layer && this.layer.properties) {
|
|
22330
22200
|
return this.layer.properties.property("opacity").set(val);
|
|
22331
22201
|
}
|
|
@@ -22350,22 +22220,22 @@ class NgwWebmapLayerAdapter {
|
|
|
22350
22220
|
return webmap.bookmark_resource.id;
|
|
22351
22221
|
}
|
|
22352
22222
|
}
|
|
22353
|
-
fetchBookmarks() {
|
|
22223
|
+
fetchBookmarks(options) {
|
|
22354
22224
|
const bookmarkResId = this.getBookmarksResourceId();
|
|
22355
22225
|
const connector = this.options.connector;
|
|
22356
22226
|
if (bookmarkResId) {
|
|
22357
|
-
return connector.getResourceOrFail(bookmarkResId).then((item) => {
|
|
22227
|
+
return connector.getResourceOrFail(bookmarkResId, options).then((item) => {
|
|
22358
22228
|
var _a;
|
|
22359
22229
|
const labelField = (_a = item.feature_layer) == null ? void 0 : _a.fields.find(
|
|
22360
22230
|
(x) => x.label_field
|
|
22361
22231
|
);
|
|
22362
22232
|
const keyname = labelField && labelField.keyname;
|
|
22363
|
-
return fetchNgwLayerItems({
|
|
22233
|
+
return fetchNgwLayerItems(__spreadValues$8({
|
|
22364
22234
|
connector,
|
|
22365
22235
|
resourceId: bookmarkResId,
|
|
22366
22236
|
geom: false,
|
|
22367
22237
|
fields: keyname ? [keyname] : void 0
|
|
22368
|
-
}).then((items) => {
|
|
22238
|
+
}, options)).then((items) => {
|
|
22369
22239
|
const bookmarks = [];
|
|
22370
22240
|
for (const i of items) {
|
|
22371
22241
|
const bookmark = new BookmarkItem({
|
|
@@ -22384,24 +22254,24 @@ class NgwWebmapLayerAdapter {
|
|
|
22384
22254
|
"Webmap was not loaded correctly, it is impossible to extract bookmarks"
|
|
22385
22255
|
);
|
|
22386
22256
|
}
|
|
22387
|
-
getLegend() {
|
|
22388
|
-
return __async$
|
|
22257
|
+
getLegend(options) {
|
|
22258
|
+
return __async$9(this, null, function* () {
|
|
22389
22259
|
const legends = [];
|
|
22390
22260
|
let deps = this.getDependLayers();
|
|
22391
22261
|
deps = deps.sort((a, b) => b.id - a.id);
|
|
22392
22262
|
for (const d of deps) {
|
|
22393
|
-
const layerLegend = yield d.getLegend();
|
|
22263
|
+
const layerLegend = yield d.getLegend(options);
|
|
22394
22264
|
legends.push(...layerLegend);
|
|
22395
22265
|
}
|
|
22396
22266
|
return legends;
|
|
22397
22267
|
});
|
|
22398
22268
|
}
|
|
22399
|
-
getIdentificationIds() {
|
|
22400
|
-
return __async$
|
|
22269
|
+
getIdentificationIds(options) {
|
|
22270
|
+
return __async$9(this, null, function* () {
|
|
22401
22271
|
const visibleLayers = [];
|
|
22402
22272
|
let ids = this._webmapLayersIds;
|
|
22403
22273
|
if (!ids) {
|
|
22404
|
-
ids = yield this._getWebMapIds();
|
|
22274
|
+
ids = yield this._getWebMapIds(options);
|
|
22405
22275
|
this._webmapLayersIds = ids;
|
|
22406
22276
|
}
|
|
22407
22277
|
if (ids && ids.length) {
|
|
@@ -22423,7 +22293,7 @@ class NgwWebmapLayerAdapter {
|
|
|
22423
22293
|
});
|
|
22424
22294
|
}
|
|
22425
22295
|
_getWebMapLayerItem() {
|
|
22426
|
-
return __async$
|
|
22296
|
+
return __async$9(this, null, function* () {
|
|
22427
22297
|
if (this.resourceId) {
|
|
22428
22298
|
const webmap = yield this.getWebMapConfig(this.resourceId);
|
|
22429
22299
|
if (webmap && webmap.root_item) {
|
|
@@ -22456,7 +22326,7 @@ class NgwWebmapLayerAdapter {
|
|
|
22456
22326
|
});
|
|
22457
22327
|
}
|
|
22458
22328
|
getWebMapConfig(id) {
|
|
22459
|
-
return __async$
|
|
22329
|
+
return __async$9(this, null, function* () {
|
|
22460
22330
|
const data = yield this.options.connector.getResource(id);
|
|
22461
22331
|
if (data) {
|
|
22462
22332
|
this.response = data;
|
|
@@ -22550,8 +22420,8 @@ class NgwWebmapLayerAdapter {
|
|
|
22550
22420
|
}
|
|
22551
22421
|
return item;
|
|
22552
22422
|
}
|
|
22553
|
-
_getWebMapIds() {
|
|
22554
|
-
return __async$
|
|
22423
|
+
_getWebMapIds(options) {
|
|
22424
|
+
return __async$9(this, null, function* () {
|
|
22555
22425
|
const webMapItem = this.layer;
|
|
22556
22426
|
if (webMapItem && webMapItem.item.item_type === "root") {
|
|
22557
22427
|
const layers = webMapItem.tree.getDescendants();
|
|
@@ -22560,7 +22430,7 @@ class NgwWebmapLayerAdapter {
|
|
|
22560
22430
|
const item = x.item;
|
|
22561
22431
|
if (item.item_type === "layer") {
|
|
22562
22432
|
const id = item.layer_style_id;
|
|
22563
|
-
const promise = this.options.connector.getResource(id).then((y) => {
|
|
22433
|
+
const promise = this.options.connector.getResource(id, options).then((y) => {
|
|
22564
22434
|
if (y) {
|
|
22565
22435
|
const parentId = Number(y.resource.parent.id);
|
|
22566
22436
|
item.parentId = parentId;
|
|
@@ -22594,7 +22464,7 @@ var __spreadValues$7 = (a, b) => {
|
|
|
22594
22464
|
return a;
|
|
22595
22465
|
};
|
|
22596
22466
|
var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22597
|
-
var __async$
|
|
22467
|
+
var __async$8 = (__this, __arguments, generator) => {
|
|
22598
22468
|
return new Promise((resolve, reject) => {
|
|
22599
22469
|
var fulfilled = (value) => {
|
|
22600
22470
|
try {
|
|
@@ -22639,7 +22509,7 @@ class NgwKit {
|
|
|
22639
22509
|
classAdapters[cls] = adapter;
|
|
22640
22510
|
}
|
|
22641
22511
|
onLoadSync(webMap) {
|
|
22642
|
-
return __async$
|
|
22512
|
+
return __async$8(this, null, function* () {
|
|
22643
22513
|
if (this.options.resourceId && this.url) {
|
|
22644
22514
|
const resourceIds = [this.options.resourceId];
|
|
22645
22515
|
if (resourceIds.length) {
|
|
@@ -22722,7 +22592,7 @@ class IdentifyItem {
|
|
|
22722
22592
|
}
|
|
22723
22593
|
identify(options = {}) {
|
|
22724
22594
|
if (this._item) {
|
|
22725
|
-
return
|
|
22595
|
+
return Promise.resolve(this._item);
|
|
22726
22596
|
}
|
|
22727
22597
|
return fetchNgwLayerItem(__spreadValues$6({
|
|
22728
22598
|
connector: this.connector,
|
|
@@ -22737,30 +22607,30 @@ class IdentifyItem {
|
|
|
22737
22607
|
return resp;
|
|
22738
22608
|
});
|
|
22739
22609
|
}
|
|
22740
|
-
resource() {
|
|
22610
|
+
resource(opt) {
|
|
22741
22611
|
if (this._resource) {
|
|
22742
|
-
return
|
|
22612
|
+
return Promise.resolve(this._resource.feature_layer);
|
|
22743
22613
|
}
|
|
22744
|
-
return this.connector.getResource(this.layerId).then((resp) => {
|
|
22614
|
+
return this.connector.getResource(this.layerId, opt).then((resp) => {
|
|
22745
22615
|
this._resource = resp;
|
|
22746
22616
|
return this._resource.feature_layer;
|
|
22747
22617
|
});
|
|
22748
22618
|
}
|
|
22749
|
-
getBounds() {
|
|
22619
|
+
getBounds(opt) {
|
|
22750
22620
|
if (this._extent) {
|
|
22751
|
-
return
|
|
22621
|
+
return Promise.resolve(this._extent);
|
|
22752
22622
|
}
|
|
22753
|
-
return fetchNgwLayerItemExtent({
|
|
22623
|
+
return fetchNgwLayerItemExtent(__spreadValues$6({
|
|
22754
22624
|
connector: this.connector,
|
|
22755
22625
|
featureId: this.id,
|
|
22756
22626
|
resourceId: this.layerId
|
|
22757
|
-
});
|
|
22627
|
+
}, opt));
|
|
22758
22628
|
}
|
|
22759
|
-
geojson() {
|
|
22629
|
+
geojson(options) {
|
|
22760
22630
|
if (this._geojson) {
|
|
22761
|
-
return
|
|
22631
|
+
return Promise.resolve(this._geojson);
|
|
22762
22632
|
}
|
|
22763
|
-
return this.identify().then((resp) => {
|
|
22633
|
+
return this.identify(options).then((resp) => {
|
|
22764
22634
|
return resp.toGeojson().then((geojson) => {
|
|
22765
22635
|
this._geojson = geojson;
|
|
22766
22636
|
return geojson;
|
|
@@ -22769,8 +22639,29 @@ class IdentifyItem {
|
|
|
22769
22639
|
}
|
|
22770
22640
|
}
|
|
22771
22641
|
|
|
22642
|
+
var __async$7 = (__this, __arguments, generator) => {
|
|
22643
|
+
return new Promise((resolve, reject) => {
|
|
22644
|
+
var fulfilled = (value) => {
|
|
22645
|
+
try {
|
|
22646
|
+
step(generator.next(value));
|
|
22647
|
+
} catch (e) {
|
|
22648
|
+
reject(e);
|
|
22649
|
+
}
|
|
22650
|
+
};
|
|
22651
|
+
var rejected = (value) => {
|
|
22652
|
+
try {
|
|
22653
|
+
step(generator.throw(value));
|
|
22654
|
+
} catch (e) {
|
|
22655
|
+
reject(e);
|
|
22656
|
+
}
|
|
22657
|
+
};
|
|
22658
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
22659
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
22660
|
+
});
|
|
22661
|
+
};
|
|
22772
22662
|
function fetchNgwLayerFeature(options) {
|
|
22773
|
-
return
|
|
22663
|
+
return __async$7(this, null, function* () {
|
|
22664
|
+
const item = yield fetchNgwLayerItem(options);
|
|
22774
22665
|
return createGeoJsonFeature(item);
|
|
22775
22666
|
});
|
|
22776
22667
|
}
|
|
@@ -22855,7 +22746,7 @@ function fetchIdentifyGeoJson(options) {
|
|
|
22855
22746
|
const withGeom = item.features.find((x) => x.geom);
|
|
22856
22747
|
if (withGeom && withGeom.geom) {
|
|
22857
22748
|
const geom = withGeom.geom;
|
|
22858
|
-
return
|
|
22749
|
+
return Promise.resolve(
|
|
22859
22750
|
createGeoJsonFeature(__spreadProps$5(__spreadValues$5({}, withGeom), {
|
|
22860
22751
|
geom
|
|
22861
22752
|
}))
|
|
@@ -22868,7 +22759,7 @@ function fetchIdentifyGeoJson(options) {
|
|
|
22868
22759
|
if (params && params.length) {
|
|
22869
22760
|
return fetchNgwLayerFeature(__spreadValues$5(__spreadProps$5(__spreadValues$5({}, requestOptions), { connector }), params[0]));
|
|
22870
22761
|
}
|
|
22871
|
-
return
|
|
22762
|
+
return Promise.resolve(void 0);
|
|
22872
22763
|
}
|
|
22873
22764
|
function fetchIdentifyItem(options) {
|
|
22874
22765
|
const { connector, identify } = options;
|
|
@@ -22878,7 +22769,7 @@ function fetchIdentifyItem(options) {
|
|
|
22878
22769
|
connector
|
|
22879
22770
|
}, options.requestOptions), params[0]));
|
|
22880
22771
|
}
|
|
22881
|
-
return
|
|
22772
|
+
return Promise.resolve(void 0);
|
|
22882
22773
|
}
|
|
22883
22774
|
function featureLayerIdentify(options) {
|
|
22884
22775
|
const { geom, signal, cache, layers } = options;
|
|
@@ -22922,9 +22813,9 @@ function getPolygonCoordinates(geom) {
|
|
|
22922
22813
|
function sendIdentifyRequest(ev, options) {
|
|
22923
22814
|
deprecatedMapClick(ev);
|
|
22924
22815
|
const [lng, lat] = ev.lngLat;
|
|
22925
|
-
const { geom, radius
|
|
22816
|
+
const { geom, radius } = options;
|
|
22926
22817
|
const geom_ = geom != null ? geom : getCirclePolygonCoordinates(lng, lat, radius);
|
|
22927
|
-
return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_
|
|
22818
|
+
return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_ }));
|
|
22928
22819
|
}
|
|
22929
22820
|
function createIdentifyItem(opt) {
|
|
22930
22821
|
return new IdentifyItem(opt);
|
|
@@ -23270,7 +23161,7 @@ const _WebMapMain = class _WebMapMain {
|
|
|
23270
23161
|
__publicField$3(this, "_mapState", []);
|
|
23271
23162
|
__publicField$3(this, "_extent");
|
|
23272
23163
|
__publicField$3(this, "_eventsStatus", {});
|
|
23273
|
-
__publicField$3(this, "
|
|
23164
|
+
__publicField$3(this, "_coordFromMapClickAbort");
|
|
23274
23165
|
__publicField$3(this, "_mapEvents", {});
|
|
23275
23166
|
this.mapAdapter = mapOptions.mapAdapter;
|
|
23276
23167
|
this._starterKits = mapOptions.starterKits || [];
|
|
@@ -23585,36 +23476,34 @@ const _WebMapMain = class _WebMapMain {
|
|
|
23585
23476
|
return { stop };
|
|
23586
23477
|
}
|
|
23587
23478
|
stopGetCoordFromMapClick() {
|
|
23588
|
-
if (this.
|
|
23589
|
-
this.
|
|
23479
|
+
if (this._coordFromMapClickAbort) {
|
|
23480
|
+
this._coordFromMapClickAbort();
|
|
23481
|
+
this._coordFromMapClickAbort = void 0;
|
|
23590
23482
|
}
|
|
23591
23483
|
}
|
|
23592
23484
|
getCoordFromMapClick() {
|
|
23593
|
-
if (!this.
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
}
|
|
23613
|
-
);
|
|
23485
|
+
if (!this._coordFromMapClickAbort) {
|
|
23486
|
+
return new Promise((resolve, reject) => {
|
|
23487
|
+
const cursor = this.getCursor() || "grab";
|
|
23488
|
+
this._removeEventListeners({ include: ["click"] });
|
|
23489
|
+
this.setCursor("crosshair");
|
|
23490
|
+
const onCancel_ = () => {
|
|
23491
|
+
this.setCursor(cursor);
|
|
23492
|
+
this._addEventsListeners({ include: ["click"] });
|
|
23493
|
+
this.mapAdapter.emitter.off("click", onMapClick);
|
|
23494
|
+
this._coordFromMapClickAbort = void 0;
|
|
23495
|
+
};
|
|
23496
|
+
const onMapClick = (e) => {
|
|
23497
|
+
onCancel_();
|
|
23498
|
+
deprecatedMapClick(e);
|
|
23499
|
+
resolve(e.lngLat);
|
|
23500
|
+
};
|
|
23501
|
+
this.mapAdapter.emitter.once("click", onMapClick);
|
|
23502
|
+
this._coordFromMapClickAbort = onCancel_;
|
|
23503
|
+
});
|
|
23614
23504
|
} else {
|
|
23615
23505
|
return this.getCoordFromMapClick();
|
|
23616
23506
|
}
|
|
23617
|
-
return this._coordFromMapClickPromise;
|
|
23618
23507
|
}
|
|
23619
23508
|
_emitStatusEvent(eventName, data) {
|
|
23620
23509
|
const _eventName = eventName;
|
|
@@ -25402,26 +25291,35 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
25402
25291
|
}, options));
|
|
25403
25292
|
}
|
|
25404
25293
|
fetchIdentifyItem(identify, requestOptions) {
|
|
25294
|
+
const abortController = new AbortController();
|
|
25295
|
+
const abortSignal = abortController.signal;
|
|
25296
|
+
if (requestOptions == null ? void 0 : requestOptions.signal) {
|
|
25297
|
+
requestOptions.signal.addEventListener("abort", abortController.abort);
|
|
25298
|
+
}
|
|
25299
|
+
requestOptions = requestOptions || {};
|
|
25300
|
+
requestOptions.signal = abortSignal;
|
|
25405
25301
|
const promise = fetchIdentifyItem({
|
|
25406
25302
|
identify,
|
|
25407
25303
|
connector: this.connector,
|
|
25408
25304
|
requestOptions
|
|
25409
25305
|
// multiple,
|
|
25410
25306
|
});
|
|
25411
|
-
this._addPromise("identify", promise);
|
|
25307
|
+
this._addPromise("identify", promise, abortController);
|
|
25412
25308
|
return promise;
|
|
25413
25309
|
}
|
|
25414
25310
|
fetchIdentifyGeoJson(identify, multiple = false) {
|
|
25311
|
+
const abortController = new AbortController();
|
|
25415
25312
|
const promise = fetchIdentifyGeoJson({
|
|
25416
25313
|
identify,
|
|
25417
25314
|
connector: this.connector,
|
|
25418
|
-
multiple
|
|
25315
|
+
multiple,
|
|
25316
|
+
requestOptions: { signal: abortController.signal }
|
|
25419
25317
|
});
|
|
25420
25318
|
if (promise && "then" in promise) {
|
|
25421
|
-
this._addPromise("identify", promise);
|
|
25319
|
+
this._addPromise("identify", promise, abortController);
|
|
25422
25320
|
return promise;
|
|
25423
25321
|
} else {
|
|
25424
|
-
return
|
|
25322
|
+
return Promise.resolve(promise);
|
|
25425
25323
|
}
|
|
25426
25324
|
}
|
|
25427
25325
|
/**
|
|
@@ -25595,7 +25493,7 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
25595
25493
|
args.forEach((name) => {
|
|
25596
25494
|
const group = this._promises[name];
|
|
25597
25495
|
if (group) {
|
|
25598
|
-
group.forEach((x) => x.
|
|
25496
|
+
group.forEach((x) => x[1].abort());
|
|
25599
25497
|
this._promises[name] = [];
|
|
25600
25498
|
}
|
|
25601
25499
|
});
|
|
@@ -25662,11 +25560,13 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
25662
25560
|
}, highlightDuration);
|
|
25663
25561
|
}
|
|
25664
25562
|
}
|
|
25563
|
+
const abortController = new AbortController();
|
|
25665
25564
|
const selectPromise = sendIdentifyRequest(ev, {
|
|
25666
25565
|
layers: ids,
|
|
25667
25566
|
connector: this.connector,
|
|
25668
25567
|
radius,
|
|
25669
|
-
geom
|
|
25568
|
+
geom,
|
|
25569
|
+
signal: abortController.signal
|
|
25670
25570
|
}).then((resp) => {
|
|
25671
25571
|
const identify = __spreadProps$1(__spreadValues$1({}, resp), {
|
|
25672
25572
|
resources: ids,
|
|
@@ -25677,22 +25577,22 @@ const _NgwMap = class _NgwMap extends WebMap {
|
|
|
25677
25577
|
this._emitStatusEvent("ngw:select", identifyEvent);
|
|
25678
25578
|
return identifyEvent;
|
|
25679
25579
|
});
|
|
25680
|
-
this._addPromise("select", selectPromise);
|
|
25580
|
+
this._addPromise("select", selectPromise, abortController);
|
|
25681
25581
|
return selectPromise;
|
|
25682
25582
|
});
|
|
25683
25583
|
}
|
|
25684
|
-
_addPromise(groupName, promise) {
|
|
25584
|
+
_addPromise(groupName, promise, abortController) {
|
|
25685
25585
|
const group = this._promises[groupName];
|
|
25686
|
-
if (group && group.
|
|
25586
|
+
if (group && group.findIndex((g) => g[0] === promise) === -1) {
|
|
25687
25587
|
const removeFromGroup = () => {
|
|
25688
|
-
const index = group.
|
|
25588
|
+
const index = group.findIndex((g) => g[0] === promise);
|
|
25689
25589
|
if (index !== -1) {
|
|
25690
25590
|
group.splice(index, 1);
|
|
25691
25591
|
}
|
|
25692
25592
|
};
|
|
25693
25593
|
promise.then(removeFromGroup);
|
|
25694
25594
|
promise.catch(removeFromGroup);
|
|
25695
|
-
group.push(promise);
|
|
25595
|
+
group.push([promise, abortController]);
|
|
25696
25596
|
}
|
|
25697
25597
|
}
|
|
25698
25598
|
_isFitFromResource() {
|