@nextgis/ngw-leaflet 3.0.0-alpha.3 → 3.0.0-alpha.5
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 +2008 -1409
- 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 +1 -1
- package/lib/ngw-leaflet.global.js +2008 -1409
- 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: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.5; author: NextGIS */
|
|
2
2
|
var NgwLeaflet = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ var NgwLeaflet = (function () {
|
|
|
65
65
|
this.domain = null;
|
|
66
66
|
if (EventEmitter.usingDomains) {
|
|
67
67
|
// if there is an active domain, then attach to it.
|
|
68
|
-
if (domain.active
|
|
68
|
+
if (domain.active) ;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
|
|
@@ -14947,6 +14947,20 @@ var NgwLeaflet = (function () {
|
|
|
14947
14947
|
function fixUrlStr(url) {
|
|
14948
14948
|
return url.replace(/([^:]\/)\/+/g, "$1");
|
|
14949
14949
|
}
|
|
14950
|
+
function updateUrlParams(urlStr, params) {
|
|
14951
|
+
const url = new URL(urlStr);
|
|
14952
|
+
const searchParams = new URLSearchParams(url.search);
|
|
14953
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
14954
|
+
if (value === void 0) {
|
|
14955
|
+
searchParams.delete(key);
|
|
14956
|
+
} else {
|
|
14957
|
+
searchParams.set(key, value);
|
|
14958
|
+
}
|
|
14959
|
+
});
|
|
14960
|
+
searchParams.set("timestamp", String((/* @__PURE__ */ new Date()).getTime()));
|
|
14961
|
+
const newSearch = [...searchParams.entries()].map(([key, value]) => `${key}=${value}`).join("&");
|
|
14962
|
+
return `${url.origin}${url.pathname}?${newSearch}`;
|
|
14963
|
+
}
|
|
14950
14964
|
|
|
14951
14965
|
function boundsToArray(bounds) {
|
|
14952
14966
|
const ne = bounds.getNorthEast();
|
|
@@ -15051,15 +15065,15 @@ var NgwLeaflet = (function () {
|
|
|
15051
15065
|
};
|
|
15052
15066
|
}
|
|
15053
15067
|
|
|
15054
|
-
var __defProp$
|
|
15055
|
-
var __defNormalProp$
|
|
15056
|
-
var __publicField$
|
|
15068
|
+
var __defProp$11 = Object.defineProperty;
|
|
15069
|
+
var __defNormalProp$11 = (obj, key, value) => key in obj ? __defProp$11(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15070
|
+
var __publicField$H = (obj, key, value) => __defNormalProp$11(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15057
15071
|
class BaseAdapter {
|
|
15058
15072
|
constructor(map, options) {
|
|
15059
15073
|
this.map = map;
|
|
15060
15074
|
this.options = options;
|
|
15061
|
-
__publicField$
|
|
15062
|
-
__publicField$
|
|
15075
|
+
__publicField$H(this, "layer");
|
|
15076
|
+
__publicField$H(this, "pane", "order-0");
|
|
15063
15077
|
if (options.order !== void 0) {
|
|
15064
15078
|
const pane = "order-" + options.order;
|
|
15065
15079
|
let exist = map.getPane(pane);
|
|
@@ -15088,19 +15102,19 @@ var NgwLeaflet = (function () {
|
|
|
15088
15102
|
};
|
|
15089
15103
|
}
|
|
15090
15104
|
|
|
15091
|
-
var __defProp$
|
|
15092
|
-
var __getOwnPropSymbols$
|
|
15093
|
-
var __hasOwnProp$
|
|
15094
|
-
var __propIsEnum$
|
|
15095
|
-
var __defNormalProp$
|
|
15096
|
-
var __spreadValues$
|
|
15105
|
+
var __defProp$10 = Object.defineProperty;
|
|
15106
|
+
var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
|
|
15107
|
+
var __hasOwnProp$I = Object.prototype.hasOwnProperty;
|
|
15108
|
+
var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
|
|
15109
|
+
var __defNormalProp$10 = (obj, key, value) => key in obj ? __defProp$10(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15110
|
+
var __spreadValues$H = (a, b) => {
|
|
15097
15111
|
for (var prop in b || (b = {}))
|
|
15098
|
-
if (__hasOwnProp$
|
|
15099
|
-
__defNormalProp$
|
|
15100
|
-
if (__getOwnPropSymbols$
|
|
15101
|
-
for (var prop of __getOwnPropSymbols$
|
|
15102
|
-
if (__propIsEnum$
|
|
15103
|
-
__defNormalProp$
|
|
15112
|
+
if (__hasOwnProp$I.call(b, prop))
|
|
15113
|
+
__defNormalProp$10(a, prop, b[prop]);
|
|
15114
|
+
if (__getOwnPropSymbols$I)
|
|
15115
|
+
for (var prop of __getOwnPropSymbols$I(b)) {
|
|
15116
|
+
if (__propIsEnum$I.call(b, prop))
|
|
15117
|
+
__defNormalProp$10(a, prop, b[prop]);
|
|
15104
15118
|
}
|
|
15105
15119
|
return a;
|
|
15106
15120
|
};
|
|
@@ -15110,7 +15124,7 @@ var NgwLeaflet = (function () {
|
|
|
15110
15124
|
}) {
|
|
15111
15125
|
const layer_ = source.target;
|
|
15112
15126
|
const feature = layer_.feature;
|
|
15113
|
-
const opt = __spreadValues$
|
|
15127
|
+
const opt = __spreadValues$H({
|
|
15114
15128
|
layer,
|
|
15115
15129
|
feature,
|
|
15116
15130
|
event: convertMapClickEvent(source),
|
|
@@ -15119,30 +15133,30 @@ var NgwLeaflet = (function () {
|
|
|
15119
15133
|
return opt;
|
|
15120
15134
|
}
|
|
15121
15135
|
|
|
15122
|
-
var __defProp
|
|
15123
|
-
var __getOwnPropSymbols$
|
|
15124
|
-
var __hasOwnProp$
|
|
15125
|
-
var __propIsEnum$
|
|
15126
|
-
var __defNormalProp
|
|
15127
|
-
var __spreadValues$
|
|
15136
|
+
var __defProp$$ = Object.defineProperty;
|
|
15137
|
+
var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
|
|
15138
|
+
var __hasOwnProp$H = Object.prototype.hasOwnProperty;
|
|
15139
|
+
var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
|
|
15140
|
+
var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15141
|
+
var __spreadValues$G = (a, b) => {
|
|
15128
15142
|
for (var prop in b || (b = {}))
|
|
15129
|
-
if (__hasOwnProp$
|
|
15130
|
-
__defNormalProp
|
|
15131
|
-
if (__getOwnPropSymbols$
|
|
15132
|
-
for (var prop of __getOwnPropSymbols$
|
|
15133
|
-
if (__propIsEnum$
|
|
15134
|
-
__defNormalProp
|
|
15143
|
+
if (__hasOwnProp$H.call(b, prop))
|
|
15144
|
+
__defNormalProp$$(a, prop, b[prop]);
|
|
15145
|
+
if (__getOwnPropSymbols$H)
|
|
15146
|
+
for (var prop of __getOwnPropSymbols$H(b)) {
|
|
15147
|
+
if (__propIsEnum$H.call(b, prop))
|
|
15148
|
+
__defNormalProp$$(a, prop, b[prop]);
|
|
15135
15149
|
}
|
|
15136
15150
|
return a;
|
|
15137
15151
|
};
|
|
15138
|
-
var __publicField$
|
|
15152
|
+
var __publicField$G = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15139
15153
|
class GeoJsonEvents {
|
|
15140
15154
|
constructor(layer) {
|
|
15141
|
-
__publicField$
|
|
15142
|
-
__publicField$
|
|
15143
|
-
__publicField$
|
|
15144
|
-
__publicField$
|
|
15145
|
-
__publicField$
|
|
15155
|
+
__publicField$G(this, "layer");
|
|
15156
|
+
__publicField$G(this, "_onclick");
|
|
15157
|
+
__publicField$G(this, "_ondblclick");
|
|
15158
|
+
__publicField$G(this, "_mouseout");
|
|
15159
|
+
__publicField$G(this, "_mouseover");
|
|
15146
15160
|
this.layer = layer;
|
|
15147
15161
|
}
|
|
15148
15162
|
handleMouseEvents(layer) {
|
|
@@ -15151,7 +15165,7 @@ var NgwLeaflet = (function () {
|
|
|
15151
15165
|
if (onClick_) {
|
|
15152
15166
|
this._onclick = (e) => {
|
|
15153
15167
|
const selected = !!this.layer._getSelected(layer);
|
|
15154
|
-
onClick_(__spreadValues$
|
|
15168
|
+
onClick_(__spreadValues$G({
|
|
15155
15169
|
selected
|
|
15156
15170
|
}, this._createMouseEvent(e)));
|
|
15157
15171
|
};
|
|
@@ -15161,7 +15175,7 @@ var NgwLeaflet = (function () {
|
|
|
15161
15175
|
this._ondblclick = (e) => {
|
|
15162
15176
|
leafletSrcExports.DomEvent.stopPropagation(e);
|
|
15163
15177
|
const selected = !!this.layer._getSelected(layer);
|
|
15164
|
-
onDoubleClick(__spreadValues$
|
|
15178
|
+
onDoubleClick(__spreadValues$G({
|
|
15165
15179
|
selected
|
|
15166
15180
|
}, this._createMouseEvent(e)));
|
|
15167
15181
|
};
|
|
@@ -15839,19 +15853,19 @@ var NgwLeaflet = (function () {
|
|
|
15839
15853
|
typeof: evaluateArgs(([arg]) => typeOfValue(arg))
|
|
15840
15854
|
};
|
|
15841
15855
|
|
|
15842
|
-
var __defProp$
|
|
15843
|
-
var __getOwnPropSymbols$
|
|
15844
|
-
var __hasOwnProp$
|
|
15845
|
-
var __propIsEnum$
|
|
15846
|
-
var __defNormalProp$
|
|
15847
|
-
var __spreadValues$
|
|
15856
|
+
var __defProp$_ = Object.defineProperty;
|
|
15857
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
|
15858
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
|
15859
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
|
15860
|
+
var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15861
|
+
var __spreadValues$F = (a, b) => {
|
|
15848
15862
|
for (var prop in b || (b = {}))
|
|
15849
|
-
if (__hasOwnProp$
|
|
15850
|
-
__defNormalProp$
|
|
15851
|
-
if (__getOwnPropSymbols$
|
|
15852
|
-
for (var prop of __getOwnPropSymbols$
|
|
15853
|
-
if (__propIsEnum$
|
|
15854
|
-
__defNormalProp$
|
|
15863
|
+
if (__hasOwnProp$G.call(b, prop))
|
|
15864
|
+
__defNormalProp$_(a, prop, b[prop]);
|
|
15865
|
+
if (__getOwnPropSymbols$G)
|
|
15866
|
+
for (var prop of __getOwnPropSymbols$G(b)) {
|
|
15867
|
+
if (__propIsEnum$G.call(b, prop))
|
|
15868
|
+
__defNormalProp$_(a, prop, b[prop]);
|
|
15855
15869
|
}
|
|
15856
15870
|
return a;
|
|
15857
15871
|
};
|
|
@@ -15863,7 +15877,7 @@ var NgwLeaflet = (function () {
|
|
|
15863
15877
|
}
|
|
15864
15878
|
return false;
|
|
15865
15879
|
}
|
|
15866
|
-
const expressions = __spreadValues$
|
|
15880
|
+
const expressions = __spreadValues$F(__spreadValues$F(__spreadValues$F(__spreadValues$F(__spreadValues$F(__spreadValues$F({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
|
|
15867
15881
|
function evaluate(expression, data = {}) {
|
|
15868
15882
|
const [name, ...args] = expression;
|
|
15869
15883
|
const expressionFun = expressions[name];
|
|
@@ -15876,19 +15890,19 @@ var NgwLeaflet = (function () {
|
|
|
15876
15890
|
throw new Error(`Expression "${name}" is not supported.`);
|
|
15877
15891
|
}
|
|
15878
15892
|
|
|
15879
|
-
var __defProp$
|
|
15880
|
-
var __getOwnPropSymbols$
|
|
15881
|
-
var __hasOwnProp$
|
|
15882
|
-
var __propIsEnum$
|
|
15883
|
-
var __defNormalProp$
|
|
15884
|
-
var __spreadValues$
|
|
15893
|
+
var __defProp$Z = Object.defineProperty;
|
|
15894
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
15895
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
15896
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
15897
|
+
var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15898
|
+
var __spreadValues$E = (a, b) => {
|
|
15885
15899
|
for (var prop in b || (b = {}))
|
|
15886
|
-
if (__hasOwnProp$
|
|
15887
|
-
__defNormalProp$
|
|
15888
|
-
if (__getOwnPropSymbols$
|
|
15889
|
-
for (var prop of __getOwnPropSymbols$
|
|
15890
|
-
if (__propIsEnum$
|
|
15891
|
-
__defNormalProp$
|
|
15900
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
15901
|
+
__defNormalProp$Z(a, prop, b[prop]);
|
|
15902
|
+
if (__getOwnPropSymbols$F)
|
|
15903
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
15904
|
+
if (__propIsEnum$F.call(b, prop))
|
|
15905
|
+
__defNormalProp$Z(a, prop, b[prop]);
|
|
15892
15906
|
}
|
|
15893
15907
|
return a;
|
|
15894
15908
|
};
|
|
@@ -15921,25 +15935,25 @@ var NgwLeaflet = (function () {
|
|
|
15921
15935
|
for (const p in expressions) {
|
|
15922
15936
|
fromCb[p] = expressions[p](feature);
|
|
15923
15937
|
}
|
|
15924
|
-
return __spreadValues$
|
|
15938
|
+
return __spreadValues$E(__spreadValues$E({}, paint), fromCb);
|
|
15925
15939
|
};
|
|
15926
15940
|
}
|
|
15927
15941
|
return;
|
|
15928
15942
|
}
|
|
15929
15943
|
|
|
15930
|
-
var __defProp$
|
|
15931
|
-
var __getOwnPropSymbols$
|
|
15932
|
-
var __hasOwnProp$
|
|
15933
|
-
var __propIsEnum$
|
|
15934
|
-
var __defNormalProp$
|
|
15935
|
-
var __spreadValues$
|
|
15944
|
+
var __defProp$Y = Object.defineProperty;
|
|
15945
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
15946
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
15947
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
15948
|
+
var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15949
|
+
var __spreadValues$D = (a, b) => {
|
|
15936
15950
|
for (var prop in b || (b = {}))
|
|
15937
|
-
if (__hasOwnProp$
|
|
15938
|
-
__defNormalProp$
|
|
15939
|
-
if (__getOwnPropSymbols$
|
|
15940
|
-
for (var prop of __getOwnPropSymbols$
|
|
15941
|
-
if (__propIsEnum$
|
|
15942
|
-
__defNormalProp$
|
|
15951
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
15952
|
+
__defNormalProp$Y(a, prop, b[prop]);
|
|
15953
|
+
if (__getOwnPropSymbols$E)
|
|
15954
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
15955
|
+
if (__propIsEnum$E.call(b, prop))
|
|
15956
|
+
__defNormalProp$Y(a, prop, b[prop]);
|
|
15943
15957
|
}
|
|
15944
15958
|
return a;
|
|
15945
15959
|
};
|
|
@@ -15986,7 +16000,7 @@ var NgwLeaflet = (function () {
|
|
|
15986
16000
|
return false;
|
|
15987
16001
|
}
|
|
15988
16002
|
function featureFilter(feature, filters) {
|
|
15989
|
-
const properties = __spreadValues$
|
|
16003
|
+
const properties = __spreadValues$D({}, feature.properties);
|
|
15990
16004
|
if (properties) {
|
|
15991
16005
|
properties.$id = feature.id;
|
|
15992
16006
|
return propertiesFilter(properties, filters);
|
|
@@ -16021,19 +16035,19 @@ var NgwLeaflet = (function () {
|
|
|
16021
16035
|
return logic === "any" ? filters_.some(filterFunction) : filters_.every(filterFunction);
|
|
16022
16036
|
}
|
|
16023
16037
|
|
|
16024
|
-
var __defProp$
|
|
16025
|
-
var __getOwnPropSymbols$
|
|
16026
|
-
var __hasOwnProp$
|
|
16027
|
-
var __propIsEnum$
|
|
16028
|
-
var __defNormalProp$
|
|
16029
|
-
var __spreadValues$
|
|
16038
|
+
var __defProp$X = Object.defineProperty;
|
|
16039
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
16040
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
16041
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
16042
|
+
var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16043
|
+
var __spreadValues$C = (a, b) => {
|
|
16030
16044
|
for (var prop in b || (b = {}))
|
|
16031
|
-
if (__hasOwnProp$
|
|
16032
|
-
__defNormalProp$
|
|
16033
|
-
if (__getOwnPropSymbols$
|
|
16034
|
-
for (var prop of __getOwnPropSymbols$
|
|
16035
|
-
if (__propIsEnum$
|
|
16036
|
-
__defNormalProp$
|
|
16045
|
+
if (__hasOwnProp$D.call(b, prop))
|
|
16046
|
+
__defNormalProp$X(a, prop, b[prop]);
|
|
16047
|
+
if (__getOwnPropSymbols$D)
|
|
16048
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
|
16049
|
+
if (__propIsEnum$D.call(b, prop))
|
|
16050
|
+
__defNormalProp$X(a, prop, b[prop]);
|
|
16037
16051
|
}
|
|
16038
16052
|
return a;
|
|
16039
16053
|
};
|
|
@@ -16062,7 +16076,7 @@ var NgwLeaflet = (function () {
|
|
|
16062
16076
|
return (feature) => {
|
|
16063
16077
|
const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
|
|
16064
16078
|
if (paint) {
|
|
16065
|
-
return __spreadValues$
|
|
16079
|
+
return __spreadValues$C(__spreadValues$C({}, mask), paint[1]);
|
|
16066
16080
|
}
|
|
16067
16081
|
return mask;
|
|
16068
16082
|
};
|
|
@@ -16086,8 +16100,8 @@ var NgwLeaflet = (function () {
|
|
|
16086
16100
|
}
|
|
16087
16101
|
function finalizePaint({ paint, defaultPaint }) {
|
|
16088
16102
|
var _a;
|
|
16089
|
-
let newPaint = __spreadValues$
|
|
16090
|
-
newPaint = __spreadValues$
|
|
16103
|
+
let newPaint = __spreadValues$C({}, defaultPaint);
|
|
16104
|
+
newPaint = __spreadValues$C(__spreadValues$C({}, newPaint), paint);
|
|
16091
16105
|
newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
|
|
16092
16106
|
newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
|
|
16093
16107
|
return newPaint;
|
|
@@ -16100,7 +16114,7 @@ var NgwLeaflet = (function () {
|
|
|
16100
16114
|
if (!paint) {
|
|
16101
16115
|
throw new Error("paint is empty");
|
|
16102
16116
|
}
|
|
16103
|
-
let newPaint = __spreadValues$
|
|
16117
|
+
let newPaint = __spreadValues$C({}, defaultPaint);
|
|
16104
16118
|
if (isPaintCallback(paint)) {
|
|
16105
16119
|
const getPaintFunction = (feature) => {
|
|
16106
16120
|
const getPaint = preparePaint({
|
|
@@ -16157,41 +16171,41 @@ var NgwLeaflet = (function () {
|
|
|
16157
16171
|
return newPaint;
|
|
16158
16172
|
}
|
|
16159
16173
|
|
|
16160
|
-
var __defProp$
|
|
16161
|
-
var __defProps$
|
|
16162
|
-
var __getOwnPropDescs$
|
|
16163
|
-
var __getOwnPropSymbols$
|
|
16164
|
-
var __hasOwnProp$
|
|
16165
|
-
var __propIsEnum$
|
|
16166
|
-
var __defNormalProp$
|
|
16167
|
-
var __spreadValues$
|
|
16174
|
+
var __defProp$W = Object.defineProperty;
|
|
16175
|
+
var __defProps$n = Object.defineProperties;
|
|
16176
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
|
16177
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
16178
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
16179
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
16180
|
+
var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16181
|
+
var __spreadValues$B = (a, b) => {
|
|
16168
16182
|
for (var prop in b || (b = {}))
|
|
16169
|
-
if (__hasOwnProp$
|
|
16170
|
-
__defNormalProp$
|
|
16171
|
-
if (__getOwnPropSymbols$
|
|
16172
|
-
for (var prop of __getOwnPropSymbols$
|
|
16173
|
-
if (__propIsEnum$
|
|
16174
|
-
__defNormalProp$
|
|
16183
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
16184
|
+
__defNormalProp$W(a, prop, b[prop]);
|
|
16185
|
+
if (__getOwnPropSymbols$C)
|
|
16186
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
16187
|
+
if (__propIsEnum$C.call(b, prop))
|
|
16188
|
+
__defNormalProp$W(a, prop, b[prop]);
|
|
16175
16189
|
}
|
|
16176
16190
|
return a;
|
|
16177
16191
|
};
|
|
16178
|
-
var __spreadProps$
|
|
16179
|
-
var __objRest$
|
|
16192
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
16193
|
+
var __objRest$8 = (source, exclude) => {
|
|
16180
16194
|
var target = {};
|
|
16181
16195
|
for (var prop in source)
|
|
16182
|
-
if (__hasOwnProp$
|
|
16196
|
+
if (__hasOwnProp$C.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
16183
16197
|
target[prop] = source[prop];
|
|
16184
|
-
if (source != null && __getOwnPropSymbols$
|
|
16185
|
-
for (var prop of __getOwnPropSymbols$
|
|
16186
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
16198
|
+
if (source != null && __getOwnPropSymbols$C)
|
|
16199
|
+
for (var prop of __getOwnPropSymbols$C(source)) {
|
|
16200
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$C.call(source, prop))
|
|
16187
16201
|
target[prop] = source[prop];
|
|
16188
16202
|
}
|
|
16189
16203
|
return target;
|
|
16190
16204
|
};
|
|
16191
|
-
var __publicField$
|
|
16205
|
+
var __publicField$F = (obj, key, value) => __defNormalProp$W(obj, key + "" , value);
|
|
16192
16206
|
class GeoJsonPaint {
|
|
16193
16207
|
constructor(layer) {
|
|
16194
|
-
__publicField$
|
|
16208
|
+
__publicField$F(this, "layer");
|
|
16195
16209
|
this.layer = layer;
|
|
16196
16210
|
}
|
|
16197
16211
|
setPaintEachLayer(paint) {
|
|
@@ -16259,7 +16273,7 @@ var NgwLeaflet = (function () {
|
|
|
16259
16273
|
return PAINT;
|
|
16260
16274
|
}
|
|
16261
16275
|
_createDivIcon(icon) {
|
|
16262
|
-
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$
|
|
16276
|
+
const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$8(_a, ["html", "rotate", "className"]);
|
|
16263
16277
|
const element = document.createElement("div");
|
|
16264
16278
|
if (className) {
|
|
16265
16279
|
element.className = className;
|
|
@@ -16270,7 +16284,7 @@ var NgwLeaflet = (function () {
|
|
|
16270
16284
|
if (html) {
|
|
16271
16285
|
element.innerHTML = html;
|
|
16272
16286
|
}
|
|
16273
|
-
const divIcon = new leafletSrcExports.DivIcon(__spreadProps$
|
|
16287
|
+
const divIcon = new leafletSrcExports.DivIcon(__spreadProps$n(__spreadValues$B({
|
|
16274
16288
|
className: ""
|
|
16275
16289
|
}, toLIconOpt), {
|
|
16276
16290
|
html: element
|
|
@@ -16296,7 +16310,7 @@ var NgwLeaflet = (function () {
|
|
|
16296
16310
|
}
|
|
16297
16311
|
return (_, latlng) => {
|
|
16298
16312
|
const p = PAINT;
|
|
16299
|
-
return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$
|
|
16313
|
+
return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$B(__spreadValues$B({}, p), icon)));
|
|
16300
16314
|
};
|
|
16301
16315
|
}
|
|
16302
16316
|
createPaintOptions(paint) {
|
|
@@ -16318,27 +16332,27 @@ var NgwLeaflet = (function () {
|
|
|
16318
16332
|
}
|
|
16319
16333
|
}
|
|
16320
16334
|
|
|
16321
|
-
var __defProp$
|
|
16322
|
-
var __defProps$
|
|
16323
|
-
var __getOwnPropDescs$
|
|
16324
|
-
var __getOwnPropSymbols$
|
|
16325
|
-
var __hasOwnProp$
|
|
16326
|
-
var __propIsEnum$
|
|
16327
|
-
var __defNormalProp$
|
|
16328
|
-
var __spreadValues$
|
|
16335
|
+
var __defProp$V = Object.defineProperty;
|
|
16336
|
+
var __defProps$m = Object.defineProperties;
|
|
16337
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
|
16338
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
16339
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
16340
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
16341
|
+
var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16342
|
+
var __spreadValues$A = (a, b) => {
|
|
16329
16343
|
for (var prop in b || (b = {}))
|
|
16330
|
-
if (__hasOwnProp$
|
|
16331
|
-
__defNormalProp$
|
|
16332
|
-
if (__getOwnPropSymbols$
|
|
16333
|
-
for (var prop of __getOwnPropSymbols$
|
|
16334
|
-
if (__propIsEnum$
|
|
16335
|
-
__defNormalProp$
|
|
16344
|
+
if (__hasOwnProp$B.call(b, prop))
|
|
16345
|
+
__defNormalProp$V(a, prop, b[prop]);
|
|
16346
|
+
if (__getOwnPropSymbols$B)
|
|
16347
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
|
16348
|
+
if (__propIsEnum$B.call(b, prop))
|
|
16349
|
+
__defNormalProp$V(a, prop, b[prop]);
|
|
16336
16350
|
}
|
|
16337
16351
|
return a;
|
|
16338
16352
|
};
|
|
16339
|
-
var __spreadProps$
|
|
16340
|
-
var __publicField$
|
|
16341
|
-
var __async$
|
|
16353
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
|
16354
|
+
var __publicField$E = (obj, key, value) => __defNormalProp$V(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
16355
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
16342
16356
|
return new Promise((resolve, reject) => {
|
|
16343
16357
|
var fulfilled = (value) => {
|
|
16344
16358
|
try {
|
|
@@ -16361,22 +16375,22 @@ var NgwLeaflet = (function () {
|
|
|
16361
16375
|
class GeoJsonAdapter extends BaseAdapter {
|
|
16362
16376
|
constructor(map, options) {
|
|
16363
16377
|
super(map, options);
|
|
16364
|
-
__publicField$
|
|
16365
|
-
__publicField$
|
|
16366
|
-
__publicField$
|
|
16367
|
-
__publicField$
|
|
16368
|
-
__publicField$
|
|
16369
|
-
__publicField$
|
|
16370
|
-
__publicField$
|
|
16371
|
-
__publicField$
|
|
16372
|
-
__publicField$
|
|
16373
|
-
__publicField$
|
|
16374
|
-
__publicField$
|
|
16375
|
-
__publicField$
|
|
16376
|
-
__publicField$
|
|
16378
|
+
__publicField$E(this, "layer");
|
|
16379
|
+
__publicField$E(this, "selected", false);
|
|
16380
|
+
__publicField$E(this, "type");
|
|
16381
|
+
__publicField$E(this, "_layers", []);
|
|
16382
|
+
__publicField$E(this, "_events");
|
|
16383
|
+
__publicField$E(this, "paint");
|
|
16384
|
+
__publicField$E(this, "selectedPaint");
|
|
16385
|
+
__publicField$E(this, "_selectedLayers", []);
|
|
16386
|
+
__publicField$E(this, "_filteredLayers", []);
|
|
16387
|
+
__publicField$E(this, "_filterFun");
|
|
16388
|
+
__publicField$E(this, "_openedPopup", []);
|
|
16389
|
+
__publicField$E(this, "_paint");
|
|
16390
|
+
__publicField$E(this, "$updateTooltip", debounce(() => {
|
|
16377
16391
|
this.updateTooltip();
|
|
16378
16392
|
}, 300));
|
|
16379
|
-
__publicField$
|
|
16393
|
+
__publicField$E(this, "$unselect", () => {
|
|
16380
16394
|
this.unselect();
|
|
16381
16395
|
});
|
|
16382
16396
|
this._events = new GeoJsonEvents(this);
|
|
@@ -16385,7 +16399,7 @@ var NgwLeaflet = (function () {
|
|
|
16385
16399
|
addLayer(options) {
|
|
16386
16400
|
Object.assign(this.options, options);
|
|
16387
16401
|
this.paint = options.paint;
|
|
16388
|
-
this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$
|
|
16402
|
+
this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$m(__spreadValues$A({}, options.nativeOptions), {
|
|
16389
16403
|
pane: this.pane
|
|
16390
16404
|
}));
|
|
16391
16405
|
this.selectedPaint = options.selectedPaint;
|
|
@@ -16434,7 +16448,7 @@ var NgwLeaflet = (function () {
|
|
|
16434
16448
|
}
|
|
16435
16449
|
getSelected() {
|
|
16436
16450
|
return this._selectedLayers.map((x) => {
|
|
16437
|
-
return __spreadValues$
|
|
16451
|
+
return __spreadValues$A({
|
|
16438
16452
|
target: this,
|
|
16439
16453
|
feature: x.feature,
|
|
16440
16454
|
layer: x
|
|
@@ -16453,14 +16467,14 @@ var NgwLeaflet = (function () {
|
|
|
16453
16467
|
const filteredLayers = [];
|
|
16454
16468
|
this._layers.forEach(({ feature, layer }) => {
|
|
16455
16469
|
if (layer) {
|
|
16456
|
-
const ok = fun ? fun(__spreadValues$
|
|
16470
|
+
const ok = fun ? fun(__spreadValues$A({
|
|
16457
16471
|
target: this,
|
|
16458
16472
|
feature,
|
|
16459
16473
|
layer
|
|
16460
16474
|
}, createFeaturePositionOptions(feature))) : true;
|
|
16461
16475
|
if (ok) {
|
|
16462
16476
|
layer_.addLayer(layer);
|
|
16463
|
-
filteredLayers.push(__spreadValues$
|
|
16477
|
+
filteredLayers.push(__spreadValues$A({
|
|
16464
16478
|
target: this,
|
|
16465
16479
|
feature,
|
|
16466
16480
|
layer
|
|
@@ -16481,7 +16495,7 @@ var NgwLeaflet = (function () {
|
|
|
16481
16495
|
getLayers() {
|
|
16482
16496
|
return this._layers.map(({ layer, feature }) => {
|
|
16483
16497
|
const visible = layer && !!layer._map;
|
|
16484
|
-
return __spreadValues$
|
|
16498
|
+
return __spreadValues$A({
|
|
16485
16499
|
feature,
|
|
16486
16500
|
layer,
|
|
16487
16501
|
visible,
|
|
@@ -16599,13 +16613,13 @@ var NgwLeaflet = (function () {
|
|
|
16599
16613
|
}
|
|
16600
16614
|
}
|
|
16601
16615
|
updatePaint(paint) {
|
|
16602
|
-
this.paint = __spreadValues$
|
|
16616
|
+
this.paint = __spreadValues$A(__spreadValues$A({}, this.paint), paint);
|
|
16603
16617
|
for (const l of this._layers) {
|
|
16604
16618
|
this._paint.setPaint(l, this.paint);
|
|
16605
16619
|
}
|
|
16606
16620
|
}
|
|
16607
16621
|
updateSelectedPaint(paint) {
|
|
16608
|
-
this.selectedPaint = __spreadValues$
|
|
16622
|
+
this.selectedPaint = __spreadValues$A(__spreadValues$A({}, this.selectedPaint), paint);
|
|
16609
16623
|
for (const l of this._selectedLayers) {
|
|
16610
16624
|
this._paint.setPaint(l, this.selectedPaint);
|
|
16611
16625
|
}
|
|
@@ -16622,7 +16636,7 @@ var NgwLeaflet = (function () {
|
|
|
16622
16636
|
if (feature.properties && labelField) {
|
|
16623
16637
|
message = feature.properties[labelField];
|
|
16624
16638
|
} else if (label) {
|
|
16625
|
-
message = label(__spreadValues$
|
|
16639
|
+
message = label(__spreadValues$A(__spreadValues$A({
|
|
16626
16640
|
target: this
|
|
16627
16641
|
}, layerDef), createFeaturePositionOptions(feature)));
|
|
16628
16642
|
}
|
|
@@ -16633,7 +16647,7 @@ var NgwLeaflet = (function () {
|
|
|
16633
16647
|
}
|
|
16634
16648
|
}
|
|
16635
16649
|
_openPopup(_0) {
|
|
16636
|
-
return __async$
|
|
16650
|
+
return __async$u(this, arguments, function* (def, options = {}, type, latLng) {
|
|
16637
16651
|
var _a, _b;
|
|
16638
16652
|
const { feature, layer } = def;
|
|
16639
16653
|
const {
|
|
@@ -16641,7 +16655,7 @@ var NgwLeaflet = (function () {
|
|
|
16641
16655
|
autoPan,
|
|
16642
16656
|
maxWidth,
|
|
16643
16657
|
closeButton: closeButton_
|
|
16644
|
-
} = __spreadValues$
|
|
16658
|
+
} = __spreadValues$A({
|
|
16645
16659
|
minWidth: 300
|
|
16646
16660
|
}, options);
|
|
16647
16661
|
const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
|
|
@@ -16657,7 +16671,7 @@ var NgwLeaflet = (function () {
|
|
|
16657
16671
|
};
|
|
16658
16672
|
let content;
|
|
16659
16673
|
if (options.createPopupContent) {
|
|
16660
|
-
content = yield options.createPopupContent(__spreadValues$
|
|
16674
|
+
content = yield options.createPopupContent(__spreadValues$A({
|
|
16661
16675
|
layer,
|
|
16662
16676
|
feature,
|
|
16663
16677
|
target: this,
|
|
@@ -16733,9 +16747,9 @@ var NgwLeaflet = (function () {
|
|
|
16733
16747
|
lopt = {
|
|
16734
16748
|
style: (feature) => {
|
|
16735
16749
|
if (feature) {
|
|
16736
|
-
return this._paint.preparePaint(__spreadValues$
|
|
16750
|
+
return this._paint.preparePaint(__spreadValues$A(__spreadValues$A({}, PAINT), paint(feature)));
|
|
16737
16751
|
} else {
|
|
16738
|
-
return this._paint.preparePaint(__spreadProps$
|
|
16752
|
+
return this._paint.preparePaint(__spreadProps$m(__spreadValues$A({}, PAINT), { type: "path" }));
|
|
16739
16753
|
}
|
|
16740
16754
|
}
|
|
16741
16755
|
};
|
|
@@ -16751,7 +16765,7 @@ var NgwLeaflet = (function () {
|
|
|
16751
16765
|
_onEachFeature(feature, layer) {
|
|
16752
16766
|
const layer_ = this.layer;
|
|
16753
16767
|
if (layer_) {
|
|
16754
|
-
const def = __spreadValues$
|
|
16768
|
+
const def = __spreadValues$A({
|
|
16755
16769
|
target: this,
|
|
16756
16770
|
feature,
|
|
16757
16771
|
layer
|
|
@@ -16786,7 +16800,7 @@ var NgwLeaflet = (function () {
|
|
|
16786
16800
|
setTimeout(() => {
|
|
16787
16801
|
if (popup) {
|
|
16788
16802
|
this._openPopup(
|
|
16789
|
-
__spreadValues$
|
|
16803
|
+
__spreadValues$A({
|
|
16790
16804
|
target: this,
|
|
16791
16805
|
layer,
|
|
16792
16806
|
feature
|
|
@@ -16804,7 +16818,7 @@ var NgwLeaflet = (function () {
|
|
|
16804
16818
|
leafletSrcExports.DomEvent.stopPropagation(e);
|
|
16805
16819
|
const layer = e.target;
|
|
16806
16820
|
const feature = layer.feature;
|
|
16807
|
-
const def = __spreadValues$
|
|
16821
|
+
const def = __spreadValues$A({
|
|
16808
16822
|
target: this,
|
|
16809
16823
|
layer,
|
|
16810
16824
|
feature
|
|
@@ -16837,7 +16851,7 @@ var NgwLeaflet = (function () {
|
|
|
16837
16851
|
}
|
|
16838
16852
|
if (this.options.onSelect) {
|
|
16839
16853
|
const features = def.feature ? [def.feature] : [];
|
|
16840
|
-
this.options.onSelect(__spreadValues$
|
|
16854
|
+
this.options.onSelect(__spreadValues$A({
|
|
16841
16855
|
type,
|
|
16842
16856
|
layer: this,
|
|
16843
16857
|
features
|
|
@@ -16929,20 +16943,20 @@ var NgwLeaflet = (function () {
|
|
|
16929
16943
|
return [promise, abortFunc];
|
|
16930
16944
|
}
|
|
16931
16945
|
|
|
16932
|
-
var __defProp$
|
|
16933
|
-
var __defNormalProp$
|
|
16934
|
-
var __publicField$
|
|
16946
|
+
var __defProp$U = Object.defineProperty;
|
|
16947
|
+
var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16948
|
+
var __publicField$D = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
16935
16949
|
class Queue {
|
|
16936
16950
|
/**
|
|
16937
16951
|
* @param {PromiseQueueOptions} options - Configuration options for the queue.
|
|
16938
16952
|
*/
|
|
16939
16953
|
constructor({ concurrency = 1, delay = 0 } = {}) {
|
|
16940
|
-
__publicField$
|
|
16941
|
-
__publicField$
|
|
16942
|
-
__publicField$
|
|
16943
|
-
__publicField$
|
|
16944
|
-
__publicField$
|
|
16945
|
-
__publicField$
|
|
16954
|
+
__publicField$D(this, "queue", []);
|
|
16955
|
+
__publicField$D(this, "concurrency");
|
|
16956
|
+
__publicField$D(this, "activeCount", 0);
|
|
16957
|
+
__publicField$D(this, "timeoutId");
|
|
16958
|
+
__publicField$D(this, "delay");
|
|
16959
|
+
__publicField$D(this, "toAbort", []);
|
|
16946
16960
|
this.concurrency = concurrency;
|
|
16947
16961
|
this.delay = delay;
|
|
16948
16962
|
}
|
|
@@ -17018,13 +17032,13 @@ var NgwLeaflet = (function () {
|
|
|
17018
17032
|
|
|
17019
17033
|
const imageQueue = new Queue({ concurrency: 6, delay: 200 });
|
|
17020
17034
|
|
|
17021
|
-
var __defProp$
|
|
17022
|
-
var __defNormalProp$
|
|
17023
|
-
var __publicField$
|
|
17035
|
+
var __defProp$T = Object.defineProperty;
|
|
17036
|
+
var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17037
|
+
var __publicField$C = (obj, key, value) => __defNormalProp$T(obj, key + "" , value);
|
|
17024
17038
|
class ImageOverlay extends leafletSrcExports.ImageOverlay {
|
|
17025
17039
|
constructor(imageUrl, bounds, options) {
|
|
17026
17040
|
super(imageUrl, bounds, options);
|
|
17027
|
-
__publicField$
|
|
17041
|
+
__publicField$C(this, "_aborter");
|
|
17028
17042
|
}
|
|
17029
17043
|
cancelLoad() {
|
|
17030
17044
|
if (this._aborter) {
|
|
@@ -17053,13 +17067,14 @@ var NgwLeaflet = (function () {
|
|
|
17053
17067
|
}
|
|
17054
17068
|
}
|
|
17055
17069
|
|
|
17056
|
-
var __defProp$
|
|
17057
|
-
var __defNormalProp$
|
|
17058
|
-
var __publicField$
|
|
17070
|
+
var __defProp$S = Object.defineProperty;
|
|
17071
|
+
var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17072
|
+
var __publicField$B = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17059
17073
|
class ImageLayer extends leafletSrcExports.Layer {
|
|
17060
17074
|
constructor(url, options) {
|
|
17075
|
+
var _a;
|
|
17061
17076
|
super(options);
|
|
17062
|
-
__publicField$
|
|
17077
|
+
__publicField$B(this, "defaultWmsParams", {
|
|
17063
17078
|
service: "WMS",
|
|
17064
17079
|
request: "GetMap",
|
|
17065
17080
|
version: "1.1.1",
|
|
@@ -17068,7 +17083,7 @@ var NgwLeaflet = (function () {
|
|
|
17068
17083
|
format: "image/jpeg",
|
|
17069
17084
|
transparent: false
|
|
17070
17085
|
});
|
|
17071
|
-
__publicField$
|
|
17086
|
+
__publicField$B(this, "options", {
|
|
17072
17087
|
crs: null,
|
|
17073
17088
|
uppercase: false,
|
|
17074
17089
|
attribution: "",
|
|
@@ -17081,11 +17096,11 @@ var NgwLeaflet = (function () {
|
|
|
17081
17096
|
viewPortBuffer: 0,
|
|
17082
17097
|
setViewDelay: 100
|
|
17083
17098
|
});
|
|
17084
|
-
__publicField$
|
|
17085
|
-
__publicField$
|
|
17086
|
-
__publicField$
|
|
17087
|
-
__publicField$
|
|
17088
|
-
__publicField$
|
|
17099
|
+
__publicField$B(this, "wmsParams");
|
|
17100
|
+
__publicField$B(this, "_url");
|
|
17101
|
+
__publicField$B(this, "_currentUrl");
|
|
17102
|
+
__publicField$B(this, "_currentOverlay");
|
|
17103
|
+
__publicField$B(this, "_loadedOverlay");
|
|
17089
17104
|
this._url = url;
|
|
17090
17105
|
const params = {};
|
|
17091
17106
|
const opts = {};
|
|
@@ -17098,7 +17113,11 @@ var NgwLeaflet = (function () {
|
|
|
17098
17113
|
}
|
|
17099
17114
|
}
|
|
17100
17115
|
leafletSrcExports.Util.setOptions(this, opts);
|
|
17101
|
-
this.wmsParams = leafletSrcExports.Util.extend(
|
|
17116
|
+
this.wmsParams = leafletSrcExports.Util.extend(
|
|
17117
|
+
{},
|
|
17118
|
+
this.defaultWmsParams,
|
|
17119
|
+
(_a = params == null ? void 0 : params.params) != null ? _a : {}
|
|
17120
|
+
);
|
|
17102
17121
|
}
|
|
17103
17122
|
setParams(params) {
|
|
17104
17123
|
leafletSrcExports.Util.extend(this.wmsParams, params);
|
|
@@ -17245,34 +17264,34 @@ var NgwLeaflet = (function () {
|
|
|
17245
17264
|
}
|
|
17246
17265
|
}
|
|
17247
17266
|
|
|
17248
|
-
var __defProp$
|
|
17249
|
-
var __getOwnPropSymbols$
|
|
17250
|
-
var __hasOwnProp$
|
|
17251
|
-
var __propIsEnum$
|
|
17252
|
-
var __defNormalProp$
|
|
17253
|
-
var __spreadValues$
|
|
17267
|
+
var __defProp$R = Object.defineProperty;
|
|
17268
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
17269
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
17270
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
17271
|
+
var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17272
|
+
var __spreadValues$z = (a, b) => {
|
|
17254
17273
|
for (var prop in b || (b = {}))
|
|
17255
|
-
if (__hasOwnProp$
|
|
17256
|
-
__defNormalProp$
|
|
17257
|
-
if (__getOwnPropSymbols$
|
|
17258
|
-
for (var prop of __getOwnPropSymbols$
|
|
17259
|
-
if (__propIsEnum$
|
|
17260
|
-
__defNormalProp$
|
|
17274
|
+
if (__hasOwnProp$A.call(b, prop))
|
|
17275
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
17276
|
+
if (__getOwnPropSymbols$A)
|
|
17277
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
|
17278
|
+
if (__propIsEnum$A.call(b, prop))
|
|
17279
|
+
__defNormalProp$R(a, prop, b[prop]);
|
|
17261
17280
|
}
|
|
17262
17281
|
return a;
|
|
17263
17282
|
};
|
|
17264
|
-
var __publicField$
|
|
17283
|
+
var __publicField$A = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17265
17284
|
class ImageAdapter extends BaseAdapter {
|
|
17266
17285
|
constructor() {
|
|
17267
17286
|
super(...arguments);
|
|
17268
|
-
__publicField$
|
|
17287
|
+
__publicField$A(this, "layer");
|
|
17269
17288
|
}
|
|
17270
17289
|
addLayer(options) {
|
|
17271
17290
|
const url = options && options.url;
|
|
17272
17291
|
if (url) {
|
|
17273
|
-
options = __spreadValues$
|
|
17292
|
+
options = __spreadValues$z({ transparent: true }, options);
|
|
17274
17293
|
const updateWmsParamsFromOpt = options.updateWmsParams;
|
|
17275
|
-
this.layer = new ImageLayer(url, __spreadValues$
|
|
17294
|
+
this.layer = new ImageLayer(url, __spreadValues$z(__spreadValues$z(__spreadValues$z({
|
|
17276
17295
|
pane: this.pane,
|
|
17277
17296
|
headers: options.headers,
|
|
17278
17297
|
setViewDelay: options.setViewDelay
|
|
@@ -17287,8 +17306,15 @@ var NgwLeaflet = (function () {
|
|
|
17287
17306
|
return this.layer;
|
|
17288
17307
|
}
|
|
17289
17308
|
}
|
|
17309
|
+
updateLayer(options) {
|
|
17310
|
+
if (this.layer) {
|
|
17311
|
+
const params = (options == null ? void 0 : options.params) || {};
|
|
17312
|
+
leafletSrcExports.Util.extend(this.layer.wmsParams, params);
|
|
17313
|
+
this.layer.update();
|
|
17314
|
+
}
|
|
17315
|
+
}
|
|
17290
17316
|
}
|
|
17291
|
-
__publicField$
|
|
17317
|
+
__publicField$A(ImageAdapter, "queue", imageQueue);
|
|
17292
17318
|
|
|
17293
17319
|
function makeRemote(Base) {
|
|
17294
17320
|
return class RemoteTileLayer extends Base {
|
|
@@ -17350,33 +17376,33 @@ var NgwLeaflet = (function () {
|
|
|
17350
17376
|
}
|
|
17351
17377
|
const TileLayer = makeRemote(TileLayerBase);
|
|
17352
17378
|
|
|
17353
|
-
var __defProp$
|
|
17354
|
-
var __defProps$
|
|
17355
|
-
var __getOwnPropDescs$
|
|
17356
|
-
var __getOwnPropSymbols$
|
|
17357
|
-
var __hasOwnProp$
|
|
17358
|
-
var __propIsEnum$
|
|
17359
|
-
var __defNormalProp$
|
|
17360
|
-
var __spreadValues$
|
|
17379
|
+
var __defProp$Q = Object.defineProperty;
|
|
17380
|
+
var __defProps$l = Object.defineProperties;
|
|
17381
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
17382
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
17383
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
17384
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
17385
|
+
var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17386
|
+
var __spreadValues$y = (a, b) => {
|
|
17361
17387
|
for (var prop in b || (b = {}))
|
|
17362
|
-
if (__hasOwnProp$
|
|
17363
|
-
__defNormalProp$
|
|
17364
|
-
if (__getOwnPropSymbols$
|
|
17365
|
-
for (var prop of __getOwnPropSymbols$
|
|
17366
|
-
if (__propIsEnum$
|
|
17367
|
-
__defNormalProp$
|
|
17388
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
17389
|
+
__defNormalProp$Q(a, prop, b[prop]);
|
|
17390
|
+
if (__getOwnPropSymbols$z)
|
|
17391
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
17392
|
+
if (__propIsEnum$z.call(b, prop))
|
|
17393
|
+
__defNormalProp$Q(a, prop, b[prop]);
|
|
17368
17394
|
}
|
|
17369
17395
|
return a;
|
|
17370
17396
|
};
|
|
17371
|
-
var __spreadProps$
|
|
17372
|
-
var __objRest$
|
|
17397
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
17398
|
+
var __objRest$7 = (source, exclude) => {
|
|
17373
17399
|
var target = {};
|
|
17374
17400
|
for (var prop in source)
|
|
17375
|
-
if (__hasOwnProp$
|
|
17401
|
+
if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
17376
17402
|
target[prop] = source[prop];
|
|
17377
|
-
if (source != null && __getOwnPropSymbols$
|
|
17378
|
-
for (var prop of __getOwnPropSymbols$
|
|
17379
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
17403
|
+
if (source != null && __getOwnPropSymbols$z)
|
|
17404
|
+
for (var prop of __getOwnPropSymbols$z(source)) {
|
|
17405
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
|
|
17380
17406
|
target[prop] = source[prop];
|
|
17381
17407
|
}
|
|
17382
17408
|
return target;
|
|
@@ -17385,9 +17411,9 @@ var NgwLeaflet = (function () {
|
|
|
17385
17411
|
addLayer(options) {
|
|
17386
17412
|
this.options = Object.assign(this.options, options);
|
|
17387
17413
|
if (options) {
|
|
17388
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17414
|
+
const _a = options, { url } = _a, opt = __objRest$7(_a, ["url"]);
|
|
17389
17415
|
if (url) {
|
|
17390
|
-
const tileLayerOptions = __spreadValues$
|
|
17416
|
+
const tileLayerOptions = __spreadValues$y({
|
|
17391
17417
|
pane: this.pane,
|
|
17392
17418
|
attribution: opt.attribution,
|
|
17393
17419
|
minZoom: opt.minZoom,
|
|
@@ -17398,7 +17424,7 @@ var NgwLeaflet = (function () {
|
|
|
17398
17424
|
}
|
|
17399
17425
|
let layer;
|
|
17400
17426
|
if (opt.headers || opt.withCredentials) {
|
|
17401
|
-
layer = new TileLayer(url, __spreadProps$
|
|
17427
|
+
layer = new TileLayer(url, __spreadProps$l(__spreadValues$y({}, tileLayerOptions), {
|
|
17402
17428
|
headers: opt.headers,
|
|
17403
17429
|
withCredentials: opt.withCredentials,
|
|
17404
17430
|
setViewDelay: opt.setViewDelay
|
|
@@ -17410,41 +17436,40 @@ var NgwLeaflet = (function () {
|
|
|
17410
17436
|
}
|
|
17411
17437
|
}
|
|
17412
17438
|
}
|
|
17413
|
-
updateLayer() {
|
|
17439
|
+
updateLayer(options) {
|
|
17414
17440
|
if (this.layer) {
|
|
17415
17441
|
const currentUrl = this.layer._url;
|
|
17416
|
-
|
|
17417
|
-
|
|
17418
|
-
|
|
17419
|
-
this.layer.setUrl(newUrl);
|
|
17442
|
+
if (options == null ? void 0 : options.params) {
|
|
17443
|
+
this.layer.setUrl(updateUrlParams(currentUrl, options.params));
|
|
17444
|
+
}
|
|
17420
17445
|
this.layer.redraw();
|
|
17421
17446
|
}
|
|
17422
17447
|
}
|
|
17423
17448
|
}
|
|
17424
17449
|
|
|
17425
|
-
var __defProp$
|
|
17426
|
-
var __defProps$
|
|
17427
|
-
var __getOwnPropDescs$
|
|
17428
|
-
var __getOwnPropSymbols$
|
|
17429
|
-
var __hasOwnProp$
|
|
17430
|
-
var __propIsEnum$
|
|
17431
|
-
var __defNormalProp$
|
|
17432
|
-
var __spreadValues$
|
|
17433
|
-
for (var prop in b || (b = {}))
|
|
17434
|
-
if (__hasOwnProp$
|
|
17435
|
-
__defNormalProp$
|
|
17436
|
-
if (__getOwnPropSymbols$
|
|
17437
|
-
for (var prop of __getOwnPropSymbols$
|
|
17438
|
-
if (__propIsEnum$
|
|
17439
|
-
__defNormalProp$
|
|
17440
|
-
}
|
|
17450
|
+
var __defProp$P = Object.defineProperty;
|
|
17451
|
+
var __defProps$k = Object.defineProperties;
|
|
17452
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
|
17453
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
17454
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
17455
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
17456
|
+
var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17457
|
+
var __spreadValues$x = (a, b) => {
|
|
17458
|
+
for (var prop in b || (b = {}))
|
|
17459
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
17460
|
+
__defNormalProp$P(a, prop, b[prop]);
|
|
17461
|
+
if (__getOwnPropSymbols$y)
|
|
17462
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
17463
|
+
if (__propIsEnum$y.call(b, prop))
|
|
17464
|
+
__defNormalProp$P(a, prop, b[prop]);
|
|
17465
|
+
}
|
|
17441
17466
|
return a;
|
|
17442
17467
|
};
|
|
17443
|
-
var __spreadProps$
|
|
17468
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
17444
17469
|
class OsmAdapter extends TileAdapter {
|
|
17445
17470
|
addLayer(options) {
|
|
17446
17471
|
const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
|
17447
|
-
return super.addLayer(__spreadProps$
|
|
17472
|
+
return super.addLayer(__spreadProps$k(__spreadValues$x({
|
|
17448
17473
|
name: "OpenStreetMap",
|
|
17449
17474
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
17450
17475
|
}, options), {
|
|
@@ -17460,33 +17485,33 @@ var NgwLeaflet = (function () {
|
|
|
17460
17485
|
}
|
|
17461
17486
|
const WmsLayer = makeRemote(WmsLayerBase);
|
|
17462
17487
|
|
|
17463
|
-
var __defProp$
|
|
17464
|
-
var __defProps$
|
|
17465
|
-
var __getOwnPropDescs$
|
|
17466
|
-
var __getOwnPropSymbols$
|
|
17467
|
-
var __hasOwnProp$
|
|
17468
|
-
var __propIsEnum$
|
|
17469
|
-
var __defNormalProp$
|
|
17470
|
-
var __spreadValues$
|
|
17488
|
+
var __defProp$O = Object.defineProperty;
|
|
17489
|
+
var __defProps$j = Object.defineProperties;
|
|
17490
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
17491
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
17492
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
17493
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
17494
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17495
|
+
var __spreadValues$w = (a, b) => {
|
|
17471
17496
|
for (var prop in b || (b = {}))
|
|
17472
|
-
if (__hasOwnProp$
|
|
17473
|
-
__defNormalProp$
|
|
17474
|
-
if (__getOwnPropSymbols$
|
|
17475
|
-
for (var prop of __getOwnPropSymbols$
|
|
17476
|
-
if (__propIsEnum$
|
|
17477
|
-
__defNormalProp$
|
|
17497
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
17498
|
+
__defNormalProp$O(a, prop, b[prop]);
|
|
17499
|
+
if (__getOwnPropSymbols$x)
|
|
17500
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
17501
|
+
if (__propIsEnum$x.call(b, prop))
|
|
17502
|
+
__defNormalProp$O(a, prop, b[prop]);
|
|
17478
17503
|
}
|
|
17479
17504
|
return a;
|
|
17480
17505
|
};
|
|
17481
|
-
var __spreadProps$
|
|
17482
|
-
var __objRest$
|
|
17506
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
17507
|
+
var __objRest$6 = (source, exclude) => {
|
|
17483
17508
|
var target = {};
|
|
17484
17509
|
for (var prop in source)
|
|
17485
|
-
if (__hasOwnProp$
|
|
17510
|
+
if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
17486
17511
|
target[prop] = source[prop];
|
|
17487
|
-
if (source != null && __getOwnPropSymbols$
|
|
17488
|
-
for (var prop of __getOwnPropSymbols$
|
|
17489
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
17512
|
+
if (source != null && __getOwnPropSymbols$x)
|
|
17513
|
+
for (var prop of __getOwnPropSymbols$x(source)) {
|
|
17514
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
|
|
17490
17515
|
target[prop] = source[prop];
|
|
17491
17516
|
}
|
|
17492
17517
|
return target;
|
|
@@ -17494,9 +17519,9 @@ var NgwLeaflet = (function () {
|
|
|
17494
17519
|
class WmsAdapter extends BaseAdapter {
|
|
17495
17520
|
addLayer(options) {
|
|
17496
17521
|
Object.assign(this.options, options);
|
|
17497
|
-
const _a = options, { url } = _a, opt = __objRest$
|
|
17522
|
+
const _a = options, { url } = _a, opt = __objRest$6(_a, ["url"]);
|
|
17498
17523
|
if (url) {
|
|
17499
|
-
const layerOptions = __spreadValues$
|
|
17524
|
+
const layerOptions = __spreadValues$w({
|
|
17500
17525
|
pane: this.pane,
|
|
17501
17526
|
attribution: opt.attribution,
|
|
17502
17527
|
minZoom: opt.minZoom,
|
|
@@ -17507,7 +17532,7 @@ var NgwLeaflet = (function () {
|
|
|
17507
17532
|
}, options.nativeOptions);
|
|
17508
17533
|
let layer;
|
|
17509
17534
|
if (opt.headers || opt.withCredentials) {
|
|
17510
|
-
layer = new WmsLayer(url, __spreadProps$
|
|
17535
|
+
layer = new WmsLayer(url, __spreadProps$j(__spreadValues$w({}, layerOptions), {
|
|
17511
17536
|
headers: opt.headers,
|
|
17512
17537
|
withCredentials: opt.withCredentials
|
|
17513
17538
|
}));
|
|
@@ -17527,33 +17552,33 @@ var NgwLeaflet = (function () {
|
|
|
17527
17552
|
];
|
|
17528
17553
|
}
|
|
17529
17554
|
|
|
17530
|
-
var __defProp$
|
|
17531
|
-
var __getOwnPropSymbols$
|
|
17532
|
-
var __hasOwnProp$
|
|
17533
|
-
var __propIsEnum$
|
|
17534
|
-
var __defNormalProp$
|
|
17535
|
-
var __spreadValues$
|
|
17555
|
+
var __defProp$N = Object.defineProperty;
|
|
17556
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
17557
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
17558
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
17559
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17560
|
+
var __spreadValues$v = (a, b) => {
|
|
17536
17561
|
for (var prop in b || (b = {}))
|
|
17537
|
-
if (__hasOwnProp$
|
|
17538
|
-
__defNormalProp$
|
|
17539
|
-
if (__getOwnPropSymbols$
|
|
17540
|
-
for (var prop of __getOwnPropSymbols$
|
|
17541
|
-
if (__propIsEnum$
|
|
17542
|
-
__defNormalProp$
|
|
17562
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
17563
|
+
__defNormalProp$N(a, prop, b[prop]);
|
|
17564
|
+
if (__getOwnPropSymbols$w)
|
|
17565
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
17566
|
+
if (__propIsEnum$w.call(b, prop))
|
|
17567
|
+
__defNormalProp$N(a, prop, b[prop]);
|
|
17543
17568
|
}
|
|
17544
17569
|
return a;
|
|
17545
17570
|
};
|
|
17546
|
-
var __publicField$
|
|
17571
|
+
var __publicField$z = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17547
17572
|
const _LeafletMapAdapter = class _LeafletMapAdapter {
|
|
17548
17573
|
constructor() {
|
|
17549
|
-
__publicField$
|
|
17550
|
-
__publicField$
|
|
17551
|
-
__publicField$
|
|
17552
|
-
__publicField$
|
|
17553
|
-
__publicField$
|
|
17554
|
-
__publicField$
|
|
17555
|
-
__publicField$
|
|
17556
|
-
__publicField$
|
|
17574
|
+
__publicField$z(this, "options", { target: "map" });
|
|
17575
|
+
__publicField$z(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
|
|
17576
|
+
__publicField$z(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
|
|
17577
|
+
__publicField$z(this, "emitter", new EventEmitter());
|
|
17578
|
+
__publicField$z(this, "map");
|
|
17579
|
+
__publicField$z(this, "_resizeObserver");
|
|
17580
|
+
__publicField$z(this, "_unselectCb", []);
|
|
17581
|
+
__publicField$z(this, "_universalEvents", [
|
|
17557
17582
|
"move",
|
|
17558
17583
|
"zoom",
|
|
17559
17584
|
"zoomend",
|
|
@@ -17561,14 +17586,14 @@ var NgwLeaflet = (function () {
|
|
|
17561
17586
|
"moveend",
|
|
17562
17587
|
"movestart"
|
|
17563
17588
|
]);
|
|
17564
|
-
__publicField$
|
|
17589
|
+
__publicField$z(this, "_positionEvents", [
|
|
17565
17590
|
"mousemove",
|
|
17566
17591
|
"mouseout",
|
|
17567
17592
|
"mouseover"
|
|
17568
17593
|
]);
|
|
17569
17594
|
}
|
|
17570
17595
|
create(options) {
|
|
17571
|
-
this.options = __spreadValues$
|
|
17596
|
+
this.options = __spreadValues$v({}, options);
|
|
17572
17597
|
if (this.options.target) {
|
|
17573
17598
|
const {
|
|
17574
17599
|
zoom,
|
|
@@ -17578,7 +17603,7 @@ var NgwLeaflet = (function () {
|
|
|
17578
17603
|
maxBounds: mb,
|
|
17579
17604
|
mapAdapterOptions
|
|
17580
17605
|
} = this.options;
|
|
17581
|
-
this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$
|
|
17606
|
+
this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$v({
|
|
17582
17607
|
attributionControl: false,
|
|
17583
17608
|
zoomControl: false,
|
|
17584
17609
|
maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
|
|
@@ -17861,7 +17886,7 @@ var NgwLeaflet = (function () {
|
|
|
17861
17886
|
}
|
|
17862
17887
|
}
|
|
17863
17888
|
};
|
|
17864
|
-
__publicField$
|
|
17889
|
+
__publicField$z(_LeafletMapAdapter, "layerAdapters", {
|
|
17865
17890
|
GEOJSON: GeoJsonAdapter,
|
|
17866
17891
|
IMAGE: ImageAdapter,
|
|
17867
17892
|
TILE: TileAdapter,
|
|
@@ -17869,11 +17894,11 @@ var NgwLeaflet = (function () {
|
|
|
17869
17894
|
// // MVT: MvtAdapter,
|
|
17870
17895
|
OSM: OsmAdapter
|
|
17871
17896
|
});
|
|
17872
|
-
__publicField$
|
|
17897
|
+
__publicField$z(_LeafletMapAdapter, "controlAdapters", {
|
|
17873
17898
|
ZOOM: leafletSrcExports.Control.Zoom,
|
|
17874
17899
|
ATTRIBUTION: AttributionControl
|
|
17875
17900
|
});
|
|
17876
|
-
__publicField$
|
|
17901
|
+
__publicField$z(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
|
|
17877
17902
|
let LeafletMapAdapter = _LeafletMapAdapter;
|
|
17878
17903
|
|
|
17879
17904
|
const svgPath = {
|
|
@@ -17948,12 +17973,12 @@ var NgwLeaflet = (function () {
|
|
|
17948
17973
|
};
|
|
17949
17974
|
}
|
|
17950
17975
|
|
|
17951
|
-
var __defProp$
|
|
17952
|
-
var __defNormalProp$
|
|
17953
|
-
var __publicField$
|
|
17976
|
+
var __defProp$M = Object.defineProperty;
|
|
17977
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17978
|
+
var __publicField$y = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17954
17979
|
const _Cache = class _Cache {
|
|
17955
17980
|
constructor(options = {}) {
|
|
17956
|
-
__publicField$
|
|
17981
|
+
__publicField$y(this, "cache", []);
|
|
17957
17982
|
var _a;
|
|
17958
17983
|
const namespace = (_a = options.namespace) != null ? _a : "default";
|
|
17959
17984
|
if (_Cache.instance[namespace]) {
|
|
@@ -18059,12 +18084,12 @@ var NgwLeaflet = (function () {
|
|
|
18059
18084
|
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
18060
18085
|
}
|
|
18061
18086
|
};
|
|
18062
|
-
__publicField$
|
|
18087
|
+
__publicField$y(_Cache, "instance", {});
|
|
18063
18088
|
let Cache = _Cache;
|
|
18064
18089
|
|
|
18065
18090
|
var pkg = {
|
|
18066
18091
|
name: "@nextgis/ngw-connector",
|
|
18067
|
-
version: "3.0.0-alpha.
|
|
18092
|
+
version: "3.0.0-alpha.5",
|
|
18068
18093
|
_priority: 12,
|
|
18069
18094
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
18070
18095
|
main: "index.js",
|
|
@@ -18073,15 +18098,15 @@ var NgwLeaflet = (function () {
|
|
|
18073
18098
|
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
18074
18099
|
types: "lib/index.d.ts",
|
|
18075
18100
|
dependencies: {
|
|
18076
|
-
"@nextgis/cache": "^3.0.0-alpha.
|
|
18077
|
-
"@nextgis/cancelable-promise": "^3.0.0-alpha.
|
|
18078
|
-
"@nextgis/utils": "^3.0.0-alpha.
|
|
18101
|
+
"@nextgis/cache": "^3.0.0-alpha.5",
|
|
18102
|
+
"@nextgis/cancelable-promise": "^3.0.0-alpha.5",
|
|
18103
|
+
"@nextgis/utils": "^3.0.0-alpha.5",
|
|
18079
18104
|
"@types/events": "^3.0.0",
|
|
18080
18105
|
events: "*",
|
|
18081
18106
|
"form-data": "^4.0.0"
|
|
18082
18107
|
},
|
|
18083
18108
|
devDependencies: {
|
|
18084
|
-
"@nextgis/build-tools": "^3.0.0-alpha.
|
|
18109
|
+
"@nextgis/build-tools": "^3.0.0-alpha.5"
|
|
18085
18110
|
},
|
|
18086
18111
|
scripts: {
|
|
18087
18112
|
clean: "rimraf ./lib",
|
|
@@ -18115,87 +18140,179 @@ var NgwLeaflet = (function () {
|
|
|
18115
18140
|
type: "git",
|
|
18116
18141
|
url: "git://github.com/nextgis/nextgis_frontend.git"
|
|
18117
18142
|
},
|
|
18143
|
+
engines: {
|
|
18144
|
+
node: ">=18.20.4"
|
|
18145
|
+
},
|
|
18118
18146
|
gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
|
|
18119
18147
|
};
|
|
18120
18148
|
|
|
18121
|
-
|
|
18122
|
-
|
|
18123
|
-
|
|
18149
|
+
const CONNECTORS = [];
|
|
18150
|
+
function addConnector(connector) {
|
|
18151
|
+
CONNECTORS.push(connector);
|
|
18152
|
+
}
|
|
18153
|
+
function findConnector(options) {
|
|
18154
|
+
return CONNECTORS.find((x) => {
|
|
18155
|
+
if (x.options.baseUrl === options.baseUrl) {
|
|
18156
|
+
if (options.auth) {
|
|
18157
|
+
if (x.options.auth) {
|
|
18158
|
+
return objectDeepEqual(x.options.auth, options.auth);
|
|
18159
|
+
}
|
|
18160
|
+
} else {
|
|
18161
|
+
return true;
|
|
18162
|
+
}
|
|
18163
|
+
}
|
|
18164
|
+
});
|
|
18165
|
+
}
|
|
18166
|
+
function removeConnector(connector) {
|
|
18167
|
+
const index = CONNECTORS.indexOf(connector);
|
|
18168
|
+
if (index !== -1) {
|
|
18169
|
+
CONNECTORS.splice(index, 1);
|
|
18170
|
+
}
|
|
18171
|
+
}
|
|
18172
|
+
|
|
18173
|
+
class AbortError extends Error {
|
|
18174
|
+
constructor(message = "AbortError") {
|
|
18175
|
+
super(message);
|
|
18176
|
+
this.name = "AbortError";
|
|
18177
|
+
}
|
|
18178
|
+
}
|
|
18179
|
+
|
|
18180
|
+
var __defProp$L = Object.defineProperty;
|
|
18181
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18182
|
+
var __publicField$x = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18124
18183
|
class NgwError extends Error {
|
|
18125
18184
|
constructor(er) {
|
|
18126
18185
|
super();
|
|
18127
|
-
__publicField$
|
|
18128
|
-
__publicField$
|
|
18129
|
-
__publicField$
|
|
18130
|
-
__publicField$
|
|
18131
|
-
__publicField$
|
|
18132
|
-
__publicField$
|
|
18133
|
-
__publicField$
|
|
18134
|
-
__publicField$
|
|
18186
|
+
__publicField$x(this, "name", "NgwError");
|
|
18187
|
+
__publicField$x(this, "title");
|
|
18188
|
+
__publicField$x(this, "message");
|
|
18189
|
+
__publicField$x(this, "detail");
|
|
18190
|
+
__publicField$x(this, "exception");
|
|
18191
|
+
__publicField$x(this, "status_code");
|
|
18192
|
+
__publicField$x(this, "data");
|
|
18193
|
+
__publicField$x(this, "guru_meditation");
|
|
18135
18194
|
Object.assign(this, er);
|
|
18136
18195
|
Object.setPrototypeOf(this, NgwError.prototype);
|
|
18137
18196
|
}
|
|
18138
18197
|
}
|
|
18139
18198
|
|
|
18140
|
-
var __defProp$
|
|
18141
|
-
var __defNormalProp$
|
|
18142
|
-
var __publicField$
|
|
18199
|
+
var __defProp$K = Object.defineProperty;
|
|
18200
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18201
|
+
var __publicField$w = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18202
|
+
class InsufficientPermissionsError extends NgwError {
|
|
18203
|
+
constructor(obj) {
|
|
18204
|
+
super(obj);
|
|
18205
|
+
__publicField$w(this, "name", "InsufficientPermissionsError");
|
|
18206
|
+
__publicField$w(this, "exception", "nextgisweb.core.exception.InsufficientPermissions");
|
|
18207
|
+
Object.setPrototypeOf(this, InsufficientPermissionsError.prototype);
|
|
18208
|
+
}
|
|
18209
|
+
}
|
|
18210
|
+
|
|
18211
|
+
var __defProp$J = Object.defineProperty;
|
|
18212
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18213
|
+
var __publicField$v = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18143
18214
|
class ResourceNotFoundError extends NgwError {
|
|
18144
18215
|
constructor(obj) {
|
|
18145
18216
|
super(obj);
|
|
18146
|
-
__publicField$
|
|
18147
|
-
__publicField$
|
|
18217
|
+
__publicField$v(this, "name", "ResourceNotFoundError");
|
|
18218
|
+
__publicField$v(this, "exception", "nextgisweb.resource.exception.ResourceNotFound");
|
|
18148
18219
|
Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
|
|
18149
18220
|
}
|
|
18150
18221
|
}
|
|
18151
18222
|
|
|
18152
|
-
|
|
18153
|
-
|
|
18223
|
+
var __defProp$I = Object.defineProperty;
|
|
18224
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18225
|
+
var __publicField$u = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18226
|
+
class BaseAPIError extends Error {
|
|
18227
|
+
constructor(message) {
|
|
18228
|
+
super(message || "Something went wrong.");
|
|
18229
|
+
__publicField$u(this, "title");
|
|
18230
|
+
this.name = "BaseAPIError";
|
|
18231
|
+
this.title = "Unknown API error";
|
|
18232
|
+
if (Error.captureStackTrace) {
|
|
18233
|
+
Error.captureStackTrace(this, BaseAPIError);
|
|
18234
|
+
}
|
|
18235
|
+
}
|
|
18154
18236
|
}
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18237
|
+
class NetworksResponseError extends BaseAPIError {
|
|
18238
|
+
// prettier-ignore
|
|
18239
|
+
constructor(message) {
|
|
18240
|
+
super(message || "There is no response from the server or problem connecting to server.");
|
|
18241
|
+
__publicField$u(this, "detail");
|
|
18242
|
+
this.title = "Network error";
|
|
18243
|
+
this.detail = "Check network connectivity and try again later.";
|
|
18244
|
+
}
|
|
18158
18245
|
}
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18168
|
-
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18174
|
-
|
|
18175
|
-
|
|
18246
|
+
class InvalidResponseError extends BaseAPIError {
|
|
18247
|
+
constructor(message) {
|
|
18248
|
+
super(message || "Something went wrong.");
|
|
18249
|
+
this.title = "Unexpected server response";
|
|
18250
|
+
}
|
|
18251
|
+
}
|
|
18252
|
+
class ServerResponseError extends BaseAPIError {
|
|
18253
|
+
constructor(data) {
|
|
18254
|
+
super(data.message);
|
|
18255
|
+
__publicField$u(this, "detail");
|
|
18256
|
+
__publicField$u(this, "data");
|
|
18257
|
+
this.title = data.title || this.title;
|
|
18258
|
+
this.detail = data.detail || null;
|
|
18259
|
+
this.data = data;
|
|
18260
|
+
}
|
|
18261
|
+
}
|
|
18262
|
+
class LunkwillError extends Error {
|
|
18263
|
+
// prettier-ignore
|
|
18264
|
+
constructor(message, data = {}) {
|
|
18265
|
+
super(message || "Unexpected error while processing long-running request.");
|
|
18266
|
+
__publicField$u(this, "title");
|
|
18267
|
+
__publicField$u(this, "data");
|
|
18268
|
+
this.name = "LunkwillError";
|
|
18269
|
+
this.title = "Long-running request error";
|
|
18270
|
+
this.data = data;
|
|
18271
|
+
if (Error.captureStackTrace) {
|
|
18272
|
+
Error.captureStackTrace(this, LunkwillError);
|
|
18176
18273
|
}
|
|
18177
18274
|
}
|
|
18178
|
-
|
|
18275
|
+
}
|
|
18276
|
+
class LunkwillRequestCancelled extends LunkwillError {
|
|
18277
|
+
constructor(data) {
|
|
18278
|
+
super("Long-running request was cancelled.", data);
|
|
18279
|
+
}
|
|
18280
|
+
}
|
|
18281
|
+
class LunkwillRequestFailed extends LunkwillError {
|
|
18282
|
+
constructor(data) {
|
|
18283
|
+
super(void 0, data);
|
|
18284
|
+
}
|
|
18179
18285
|
}
|
|
18180
18286
|
|
|
18181
|
-
var __defProp$
|
|
18182
|
-
var __getOwnPropSymbols$
|
|
18183
|
-
var __hasOwnProp$
|
|
18184
|
-
var __propIsEnum$
|
|
18185
|
-
var __defNormalProp$
|
|
18186
|
-
var __spreadValues$
|
|
18287
|
+
var __defProp$H = Object.defineProperty;
|
|
18288
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
18289
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
18290
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
18291
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18292
|
+
var __spreadValues$u = (a, b) => {
|
|
18187
18293
|
for (var prop in b || (b = {}))
|
|
18188
|
-
if (__hasOwnProp$
|
|
18189
|
-
__defNormalProp$
|
|
18190
|
-
if (__getOwnPropSymbols$
|
|
18191
|
-
for (var prop of __getOwnPropSymbols$
|
|
18192
|
-
if (__propIsEnum$
|
|
18193
|
-
__defNormalProp$
|
|
18294
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
18295
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
18296
|
+
if (__getOwnPropSymbols$v)
|
|
18297
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
18298
|
+
if (__propIsEnum$v.call(b, prop))
|
|
18299
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
18194
18300
|
}
|
|
18195
18301
|
return a;
|
|
18196
18302
|
};
|
|
18197
|
-
var
|
|
18198
|
-
|
|
18303
|
+
var __objRest$5 = (source, exclude) => {
|
|
18304
|
+
var target = {};
|
|
18305
|
+
for (var prop in source)
|
|
18306
|
+
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
18307
|
+
target[prop] = source[prop];
|
|
18308
|
+
if (source != null && __getOwnPropSymbols$v)
|
|
18309
|
+
for (var prop of __getOwnPropSymbols$v(source)) {
|
|
18310
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
|
|
18311
|
+
target[prop] = source[prop];
|
|
18312
|
+
}
|
|
18313
|
+
return target;
|
|
18314
|
+
};
|
|
18315
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
18199
18316
|
return new Promise((resolve, reject) => {
|
|
18200
18317
|
var fulfilled = (value) => {
|
|
18201
18318
|
try {
|
|
@@ -18215,51 +18332,904 @@ var NgwLeaflet = (function () {
|
|
|
18215
18332
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
18216
18333
|
});
|
|
18217
18334
|
};
|
|
18218
|
-
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18223
|
-
|
|
18224
|
-
|
|
18225
|
-
|
|
18226
|
-
|
|
18227
|
-
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18232
|
-
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18236
|
-
|
|
18237
|
-
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
|
|
18335
|
+
function lunkwillCheckResponse(lwResp) {
|
|
18336
|
+
const ct = lwResp.headers.get("content-type");
|
|
18337
|
+
return ct !== void 0 && ct !== null && ct.includes("application/vnd.lunkwill.request-summary+json");
|
|
18338
|
+
}
|
|
18339
|
+
function responseJson(response) {
|
|
18340
|
+
return __async$t(this, null, function* () {
|
|
18341
|
+
try {
|
|
18342
|
+
return response.json();
|
|
18343
|
+
} catch (e) {
|
|
18344
|
+
throw new Error();
|
|
18345
|
+
}
|
|
18346
|
+
});
|
|
18347
|
+
}
|
|
18348
|
+
function lunkwillResponseUrl(lwResp) {
|
|
18349
|
+
return __async$t(this, null, function* () {
|
|
18350
|
+
const lwData = yield responseJson(lwResp);
|
|
18351
|
+
let delay = lwData.delay_ms;
|
|
18352
|
+
const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
|
|
18353
|
+
const sum = `/api/lunkwill/${lwData.id}/summary`;
|
|
18354
|
+
const res = `/api/lunkwill/${lwData.id}/response`;
|
|
18355
|
+
const sleep = (msec) => new Promise((resolve) => setTimeout(resolve, msec));
|
|
18356
|
+
let failed = false;
|
|
18357
|
+
let ready = false;
|
|
18358
|
+
while (!ready) {
|
|
18359
|
+
yield sleep(failed ? retry : delay);
|
|
18360
|
+
failed = false;
|
|
18361
|
+
let lwResp2;
|
|
18362
|
+
let lwData2;
|
|
18363
|
+
try {
|
|
18364
|
+
lwResp2 = yield fetch(sum, { credentials: "same-origin" });
|
|
18365
|
+
lwData2 = yield lwResp2.json();
|
|
18366
|
+
} catch (e) {
|
|
18367
|
+
failed = true;
|
|
18368
|
+
continue;
|
|
18369
|
+
}
|
|
18370
|
+
switch (lwData2.status) {
|
|
18371
|
+
case void 0:
|
|
18372
|
+
throw new LunkwillError(void 0, lwData2);
|
|
18373
|
+
case "ready":
|
|
18374
|
+
ready = true;
|
|
18375
|
+
break;
|
|
18376
|
+
case "cancelled":
|
|
18377
|
+
throw new LunkwillRequestCancelled(lwData2);
|
|
18378
|
+
case "failed":
|
|
18379
|
+
throw new LunkwillRequestFailed(lwData2);
|
|
18380
|
+
case "spooled":
|
|
18381
|
+
case "processing":
|
|
18382
|
+
case "buffering":
|
|
18383
|
+
delay = lwData2.delay_ms;
|
|
18384
|
+
break;
|
|
18385
|
+
default:
|
|
18386
|
+
throw new LunkwillError(void 0, lwData2);
|
|
18250
18387
|
}
|
|
18251
18388
|
}
|
|
18252
|
-
|
|
18253
|
-
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18389
|
+
return res;
|
|
18390
|
+
});
|
|
18391
|
+
}
|
|
18392
|
+
function lunkwillFetch(lwRespUrl) {
|
|
18393
|
+
return __async$t(this, null, function* () {
|
|
18394
|
+
try {
|
|
18395
|
+
return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
|
|
18396
|
+
} catch (e) {
|
|
18397
|
+
throw new NetworksResponseError();
|
|
18258
18398
|
}
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18399
|
+
});
|
|
18400
|
+
}
|
|
18401
|
+
const mediaContentTypes = [
|
|
18402
|
+
"application/pdf",
|
|
18403
|
+
"image/png",
|
|
18404
|
+
"image/jpeg",
|
|
18405
|
+
"image/tiff",
|
|
18406
|
+
"text/csv"
|
|
18407
|
+
];
|
|
18408
|
+
const mediaContentTypesRegex = new RegExp(mediaContentTypes.join("|"));
|
|
18409
|
+
function isMediaContentType(contentType) {
|
|
18410
|
+
return mediaContentTypesRegex.test(contentType);
|
|
18411
|
+
}
|
|
18412
|
+
function encodeQueryParams(value) {
|
|
18413
|
+
const result = [];
|
|
18414
|
+
for (const [k, v] of Object.entries(value)) {
|
|
18415
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") {
|
|
18416
|
+
result.push(`${k}=${encodeURIComponent(v)}`);
|
|
18417
|
+
} else if (Array.isArray(v)) {
|
|
18418
|
+
result.push(`${k}=${v.map(encodeURIComponent).join(",")}`);
|
|
18419
|
+
} else {
|
|
18420
|
+
for (const [sk, sv] of Object.entries(v)) {
|
|
18421
|
+
const ske = `${k}[${encodeURIComponent(sk)}]`;
|
|
18422
|
+
if (typeof sv === "string" || typeof sv === "number" || typeof sv === "boolean") {
|
|
18423
|
+
result.push(`${ske}=${encodeURIComponent(sv)}`);
|
|
18424
|
+
} else if (Array.isArray(sv)) {
|
|
18425
|
+
const sve = sv.map(encodeURIComponent);
|
|
18426
|
+
result.push(`${ske}=${sve.join(",")}`);
|
|
18427
|
+
}
|
|
18428
|
+
}
|
|
18429
|
+
}
|
|
18430
|
+
}
|
|
18431
|
+
return result.join("&");
|
|
18432
|
+
}
|
|
18433
|
+
function generateUrl(path, query) {
|
|
18434
|
+
let urlParams = "";
|
|
18435
|
+
if (query !== void 0) {
|
|
18436
|
+
urlParams = "?" + encodeQueryParams(query);
|
|
18437
|
+
}
|
|
18438
|
+
return path + urlParams;
|
|
18439
|
+
}
|
|
18440
|
+
function request(path, options, cacheEngine) {
|
|
18441
|
+
return __async$t(this, null, function* () {
|
|
18442
|
+
var _b;
|
|
18443
|
+
const defaults = {
|
|
18444
|
+
method: "GET",
|
|
18445
|
+
credentials: "same-origin",
|
|
18446
|
+
headers: {}
|
|
18447
|
+
};
|
|
18448
|
+
const _a = __spreadValues$u(__spreadValues$u({}, defaults), options), {
|
|
18449
|
+
withCredentials,
|
|
18450
|
+
responseType,
|
|
18451
|
+
cacheProps,
|
|
18452
|
+
cacheName,
|
|
18453
|
+
lunkwill,
|
|
18454
|
+
cache,
|
|
18455
|
+
query,
|
|
18456
|
+
json
|
|
18457
|
+
} = _a, opt = __objRest$5(_a, [
|
|
18458
|
+
"withCredentials",
|
|
18459
|
+
"responseType",
|
|
18460
|
+
"cacheProps",
|
|
18461
|
+
"cacheName",
|
|
18462
|
+
"lunkwill",
|
|
18463
|
+
"cache",
|
|
18464
|
+
"query",
|
|
18465
|
+
"json"
|
|
18466
|
+
]);
|
|
18467
|
+
if (withCredentials) {
|
|
18468
|
+
opt.credentials = "include";
|
|
18469
|
+
}
|
|
18470
|
+
let useLunkwill = false;
|
|
18471
|
+
if (lunkwill !== void 0) {
|
|
18472
|
+
lunkwill.toHeaders(opt.headers || {});
|
|
18473
|
+
useLunkwill = true;
|
|
18474
|
+
}
|
|
18475
|
+
const lunkwillReturnUrl = !!opt.lunkwillReturnUrl;
|
|
18476
|
+
delete opt.lunkwillReturnUrl;
|
|
18477
|
+
if (json !== void 0) {
|
|
18478
|
+
opt.body = JSON.stringify(json);
|
|
18479
|
+
const headers = opt.headers || {};
|
|
18480
|
+
headers["Content-Type"] = "application/json";
|
|
18481
|
+
opt.headers = headers;
|
|
18482
|
+
}
|
|
18483
|
+
const url = generateUrl(path, query);
|
|
18484
|
+
const makeRequest = () => __async$t(this, null, function* () {
|
|
18485
|
+
let response;
|
|
18486
|
+
try {
|
|
18487
|
+
response = yield fetch(url, opt);
|
|
18488
|
+
} catch (e) {
|
|
18489
|
+
if (e.name === "AbortError") {
|
|
18490
|
+
throw e;
|
|
18491
|
+
}
|
|
18492
|
+
throw new NetworksResponseError();
|
|
18493
|
+
}
|
|
18494
|
+
if (useLunkwill && lunkwillCheckResponse(response)) {
|
|
18495
|
+
const lwRespUrl = yield lunkwillResponseUrl(response);
|
|
18496
|
+
if (lunkwillReturnUrl) {
|
|
18497
|
+
return lwRespUrl;
|
|
18498
|
+
}
|
|
18499
|
+
response = yield lunkwillFetch(lwRespUrl);
|
|
18500
|
+
}
|
|
18501
|
+
const respCType = response.headers.get("content-type");
|
|
18502
|
+
const respJSON = respCType && (respCType.includes("application/json") || respCType.includes("application/vnd.lunkwill.request-summary+json"));
|
|
18503
|
+
let body;
|
|
18504
|
+
try {
|
|
18505
|
+
const respMedia = respCType && isMediaContentType(respCType);
|
|
18506
|
+
if (responseType === "blob" || respMedia) {
|
|
18507
|
+
body = yield response.blob();
|
|
18508
|
+
} else if (respJSON) {
|
|
18509
|
+
body = yield response.json();
|
|
18510
|
+
} else {
|
|
18511
|
+
throw new InvalidResponseError();
|
|
18512
|
+
}
|
|
18513
|
+
} catch (e) {
|
|
18514
|
+
if (e.name === "AbortError" || e instanceof InvalidResponseError) {
|
|
18515
|
+
throw e;
|
|
18516
|
+
}
|
|
18517
|
+
throw new InvalidResponseError();
|
|
18518
|
+
}
|
|
18519
|
+
if (400 <= response.status && response.status <= 599) {
|
|
18520
|
+
throw new ServerResponseError(body);
|
|
18521
|
+
}
|
|
18522
|
+
return body;
|
|
18523
|
+
});
|
|
18524
|
+
if (cacheEngine && cache && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
|
|
18525
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadValues$u({}, objectRemoveEmpty({
|
|
18526
|
+
withCredentials,
|
|
18527
|
+
responseType
|
|
18528
|
+
}));
|
|
18529
|
+
return cacheEngine.add(cacheName || url, makeRequest, cacheOptions, false);
|
|
18530
|
+
}
|
|
18531
|
+
return makeRequest();
|
|
18532
|
+
});
|
|
18533
|
+
}
|
|
18534
|
+
|
|
18535
|
+
var __defProp$G = Object.defineProperty;
|
|
18536
|
+
var __defProps$i = Object.defineProperties;
|
|
18537
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
18538
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
18539
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
18540
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
18541
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18542
|
+
var __spreadValues$t = (a, b) => {
|
|
18543
|
+
for (var prop in b || (b = {}))
|
|
18544
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
18545
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
18546
|
+
if (__getOwnPropSymbols$u)
|
|
18547
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
18548
|
+
if (__propIsEnum$u.call(b, prop))
|
|
18549
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
18550
|
+
}
|
|
18551
|
+
return a;
|
|
18552
|
+
};
|
|
18553
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
18554
|
+
var __objRest$4 = (source, exclude) => {
|
|
18555
|
+
var target = {};
|
|
18556
|
+
for (var prop in source)
|
|
18557
|
+
if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
18558
|
+
target[prop] = source[prop];
|
|
18559
|
+
if (source != null && __getOwnPropSymbols$u)
|
|
18560
|
+
for (var prop of __getOwnPropSymbols$u(source)) {
|
|
18561
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
|
|
18562
|
+
target[prop] = source[prop];
|
|
18563
|
+
}
|
|
18564
|
+
return target;
|
|
18565
|
+
};
|
|
18566
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
18567
|
+
return new Promise((resolve, reject) => {
|
|
18568
|
+
var fulfilled = (value) => {
|
|
18569
|
+
try {
|
|
18570
|
+
step(generator.next(value));
|
|
18571
|
+
} catch (e) {
|
|
18572
|
+
reject(e);
|
|
18573
|
+
}
|
|
18574
|
+
};
|
|
18575
|
+
var rejected = (value) => {
|
|
18576
|
+
try {
|
|
18577
|
+
step(generator.throw(value));
|
|
18578
|
+
} catch (e) {
|
|
18579
|
+
reject(e);
|
|
18580
|
+
}
|
|
18581
|
+
};
|
|
18582
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18583
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
18584
|
+
});
|
|
18585
|
+
};
|
|
18586
|
+
function routeURL(name, baseUrl, routeData, ...rest) {
|
|
18587
|
+
const [template, ...params] = routeData[name];
|
|
18588
|
+
const first = rest[0];
|
|
18589
|
+
let sub;
|
|
18590
|
+
if (first === void 0) {
|
|
18591
|
+
sub = [];
|
|
18592
|
+
} else if (typeof first === "object" && first !== null) {
|
|
18593
|
+
if (rest.length > 1) {
|
|
18594
|
+
throw new Error("Too many arguments for route(name, object)!");
|
|
18595
|
+
}
|
|
18596
|
+
sub = [];
|
|
18597
|
+
for (const [p, v] of Object.entries(first)) {
|
|
18598
|
+
sub[params.indexOf(p)] = String(v);
|
|
18599
|
+
}
|
|
18600
|
+
} else {
|
|
18601
|
+
sub = rest.map((v) => String(v));
|
|
18602
|
+
}
|
|
18603
|
+
return fixUrlStr(
|
|
18604
|
+
baseUrl + template.replace(/\{(\w+)\}/g, function(m, a) {
|
|
18605
|
+
const idx = parseInt(a);
|
|
18606
|
+
const value = sub[idx];
|
|
18607
|
+
if (value === void 0) {
|
|
18608
|
+
const msg = `Undefined parameter ${idx} in "${template}".`;
|
|
18609
|
+
throw new Error(msg);
|
|
18610
|
+
}
|
|
18611
|
+
return String(value);
|
|
18612
|
+
})
|
|
18613
|
+
);
|
|
18614
|
+
}
|
|
18615
|
+
function route(name, connector, ...rest) {
|
|
18616
|
+
const result = {
|
|
18617
|
+
url: (opt) => __async$s(this, null, function* () {
|
|
18618
|
+
var _a;
|
|
18619
|
+
const routeData = yield connector.connect();
|
|
18620
|
+
const template = routeURL(
|
|
18621
|
+
name,
|
|
18622
|
+
(_a = connector.options.baseUrl) != null ? _a : "",
|
|
18623
|
+
routeData,
|
|
18624
|
+
...rest
|
|
18625
|
+
);
|
|
18626
|
+
return generateUrl(template, opt == null ? void 0 : opt.query);
|
|
18627
|
+
})
|
|
18628
|
+
};
|
|
18629
|
+
const methods = ["get", "post", "put", "delete", "patch"];
|
|
18630
|
+
for (const method of methods) {
|
|
18631
|
+
const methodResp = (requestOptions) => __async$s(this, null, function* () {
|
|
18632
|
+
var _b;
|
|
18633
|
+
const _a = requestOptions || {}, { headers: optHeaders } = _a, restOpt = __objRest$4(_a, ["headers"]);
|
|
18634
|
+
const routeData = yield connector.connect();
|
|
18635
|
+
const template = routeURL(
|
|
18636
|
+
name,
|
|
18637
|
+
(_b = connector.options.baseUrl) != null ? _b : "",
|
|
18638
|
+
routeData,
|
|
18639
|
+
...rest
|
|
18640
|
+
);
|
|
18641
|
+
const headers = objectRemoveEmpty(__spreadValues$t(__spreadValues$t({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
|
|
18642
|
+
return request(
|
|
18643
|
+
template,
|
|
18644
|
+
__spreadProps$i(__spreadValues$t({
|
|
18645
|
+
headers
|
|
18646
|
+
}, restOpt), {
|
|
18647
|
+
method
|
|
18648
|
+
}),
|
|
18649
|
+
connector.cache
|
|
18650
|
+
);
|
|
18651
|
+
});
|
|
18652
|
+
result[method] = methodResp;
|
|
18653
|
+
}
|
|
18654
|
+
return result;
|
|
18655
|
+
}
|
|
18656
|
+
|
|
18657
|
+
var __defProp$F = Object.defineProperty;
|
|
18658
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18659
|
+
var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, key + "" , value);
|
|
18660
|
+
class NetworkError extends Error {
|
|
18661
|
+
constructor(url) {
|
|
18662
|
+
super();
|
|
18663
|
+
__publicField$t(this, "name", "NetworkError");
|
|
18664
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
18665
|
+
this.message = `Unable to request ${url}.
|
|
18666
|
+
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
18667
|
+
}
|
|
18668
|
+
}
|
|
18669
|
+
|
|
18670
|
+
function isObject(val) {
|
|
18671
|
+
return Object.prototype.toString.call(val) === "[object Object]";
|
|
18672
|
+
}
|
|
18673
|
+
|
|
18674
|
+
let loadData;
|
|
18675
|
+
{
|
|
18676
|
+
loadData = (url, callback, options = {}, error, onCancel) => {
|
|
18677
|
+
options.method = options.method || "GET";
|
|
18678
|
+
const xhr = new XMLHttpRequest();
|
|
18679
|
+
xhr.open(options.method || "GET", url, true);
|
|
18680
|
+
if (options.responseType === "blob") {
|
|
18681
|
+
xhr.responseType = options.responseType;
|
|
18682
|
+
}
|
|
18683
|
+
const getResponseText = () => {
|
|
18684
|
+
try {
|
|
18685
|
+
return JSON.parse(xhr.responseText);
|
|
18686
|
+
} catch (er) {
|
|
18687
|
+
return xhr.responseText;
|
|
18688
|
+
}
|
|
18689
|
+
};
|
|
18690
|
+
const processingResponse = (forError = false) => {
|
|
18691
|
+
const cb = forError ? error : callback;
|
|
18692
|
+
if (options.responseType === "blob") {
|
|
18693
|
+
cb(xhr.response);
|
|
18694
|
+
} else {
|
|
18695
|
+
if (xhr.responseText) {
|
|
18696
|
+
cb(getResponseText());
|
|
18697
|
+
} else {
|
|
18698
|
+
error({ message: "" });
|
|
18699
|
+
}
|
|
18700
|
+
}
|
|
18701
|
+
};
|
|
18702
|
+
xhr.onload = () => {
|
|
18703
|
+
if ([401, 403, 404, 422, 500].indexOf(xhr.status) !== -1) {
|
|
18704
|
+
error(new NgwError(getResponseText()));
|
|
18705
|
+
}
|
|
18706
|
+
processingResponse();
|
|
18707
|
+
};
|
|
18708
|
+
xhr.onerror = (er) => {
|
|
18709
|
+
if (xhr.status === 0) {
|
|
18710
|
+
error(new NetworkError(url));
|
|
18711
|
+
} else {
|
|
18712
|
+
error(er);
|
|
18713
|
+
}
|
|
18714
|
+
};
|
|
18715
|
+
xhr.upload.onprogress = function(e) {
|
|
18716
|
+
if (e.lengthComputable) {
|
|
18717
|
+
const percentComplete = e.loaded / e.total * 100;
|
|
18718
|
+
if (options.onProgress) {
|
|
18719
|
+
options.onProgress(percentComplete, e);
|
|
18720
|
+
}
|
|
18721
|
+
}
|
|
18722
|
+
};
|
|
18723
|
+
const headers = options.headers;
|
|
18724
|
+
if (headers) {
|
|
18725
|
+
for (const h in headers) {
|
|
18726
|
+
const header = headers[h];
|
|
18727
|
+
if (typeof header === "string") {
|
|
18728
|
+
xhr.setRequestHeader(h, header);
|
|
18729
|
+
}
|
|
18730
|
+
}
|
|
18731
|
+
}
|
|
18732
|
+
if (options.withCredentials !== void 0) {
|
|
18733
|
+
xhr.withCredentials = options.withCredentials;
|
|
18734
|
+
}
|
|
18735
|
+
let data;
|
|
18736
|
+
if (options.file) {
|
|
18737
|
+
data = new FormData();
|
|
18738
|
+
data.append("file", options.file);
|
|
18739
|
+
if (options.data) {
|
|
18740
|
+
for (const d in options.data) {
|
|
18741
|
+
data.append(d, data[d]);
|
|
18742
|
+
}
|
|
18743
|
+
}
|
|
18744
|
+
} else {
|
|
18745
|
+
data = options.data ? typeof options.data === "string" ? options.data : JSON.stringify(options.data) : null;
|
|
18746
|
+
}
|
|
18747
|
+
if (onCancel) {
|
|
18748
|
+
onCancel(() => {
|
|
18749
|
+
xhr.abort();
|
|
18750
|
+
});
|
|
18751
|
+
}
|
|
18752
|
+
xhr.send(data);
|
|
18753
|
+
};
|
|
18754
|
+
}
|
|
18755
|
+
|
|
18756
|
+
const templateRe = /\{ *([\w_-]+) *\}/g;
|
|
18757
|
+
function template(str, data) {
|
|
18758
|
+
return str.replace(templateRe, (s, key) => {
|
|
18759
|
+
let value = data[key];
|
|
18760
|
+
if (value === void 0) {
|
|
18761
|
+
throw new Error("No value provided for letiable " + s);
|
|
18762
|
+
} else if (typeof value === "function") {
|
|
18763
|
+
value = value(data);
|
|
18764
|
+
}
|
|
18765
|
+
return value;
|
|
18766
|
+
});
|
|
18767
|
+
}
|
|
18768
|
+
|
|
18769
|
+
var __defProp$E = Object.defineProperty;
|
|
18770
|
+
var __defProps$h = Object.defineProperties;
|
|
18771
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
18772
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
18773
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
18774
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
18775
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18776
|
+
var __spreadValues$s = (a, b) => {
|
|
18777
|
+
for (var prop in b || (b = {}))
|
|
18778
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
18779
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
18780
|
+
if (__getOwnPropSymbols$t)
|
|
18781
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
18782
|
+
if (__propIsEnum$t.call(b, prop))
|
|
18783
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
18784
|
+
}
|
|
18785
|
+
return a;
|
|
18786
|
+
};
|
|
18787
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
18788
|
+
var __objRest$3 = (source, exclude) => {
|
|
18789
|
+
var target = {};
|
|
18790
|
+
for (var prop in source)
|
|
18791
|
+
if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
18792
|
+
target[prop] = source[prop];
|
|
18793
|
+
if (source != null && __getOwnPropSymbols$t)
|
|
18794
|
+
for (var prop of __getOwnPropSymbols$t(source)) {
|
|
18795
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
|
|
18796
|
+
target[prop] = source[prop];
|
|
18797
|
+
}
|
|
18798
|
+
return target;
|
|
18799
|
+
};
|
|
18800
|
+
var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18801
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
18802
|
+
return new Promise((resolve, reject) => {
|
|
18803
|
+
var fulfilled = (value) => {
|
|
18804
|
+
try {
|
|
18805
|
+
step(generator.next(value));
|
|
18806
|
+
} catch (e) {
|
|
18807
|
+
reject(e);
|
|
18808
|
+
}
|
|
18809
|
+
};
|
|
18810
|
+
var rejected = (value) => {
|
|
18811
|
+
try {
|
|
18812
|
+
step(generator.throw(value));
|
|
18813
|
+
} catch (e) {
|
|
18814
|
+
reject(e);
|
|
18815
|
+
}
|
|
18816
|
+
};
|
|
18817
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18818
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
18819
|
+
});
|
|
18820
|
+
};
|
|
18821
|
+
let ID$2 = 0;
|
|
18822
|
+
let REQUEST_ID = 0;
|
|
18823
|
+
class NgwConnector {
|
|
18824
|
+
constructor(options) {
|
|
18825
|
+
this.options = options;
|
|
18826
|
+
__publicField$s(this, "id", ID$2++);
|
|
18827
|
+
__publicField$s(this, "emitter", new EventEmitter());
|
|
18828
|
+
__publicField$s(this, "user");
|
|
18829
|
+
__publicField$s(this, "cache");
|
|
18830
|
+
__publicField$s(this, "withCredentials");
|
|
18831
|
+
__publicField$s(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
18832
|
+
__publicField$s(this, "routeStr", "/api/component/pyramid/route");
|
|
18833
|
+
__publicField$s(this, "activeRequests", {});
|
|
18834
|
+
__publicField$s(this, "requestTransform");
|
|
18835
|
+
const exist = findConnector(options);
|
|
18836
|
+
this.cache = new Cache({ namespace: options.cacheId });
|
|
18837
|
+
if (exist) {
|
|
18838
|
+
return exist;
|
|
18839
|
+
} else {
|
|
18840
|
+
const { route: route2, requestTransform, withCredentials } = this.options;
|
|
18841
|
+
if (route2) {
|
|
18842
|
+
this.routeStr = route2;
|
|
18843
|
+
}
|
|
18844
|
+
if (requestTransform) {
|
|
18845
|
+
this.requestTransform = requestTransform;
|
|
18846
|
+
}
|
|
18847
|
+
if (withCredentials !== void 0) {
|
|
18848
|
+
this.withCredentials = withCredentials;
|
|
18849
|
+
}
|
|
18850
|
+
addConnector(this);
|
|
18851
|
+
}
|
|
18852
|
+
}
|
|
18853
|
+
static create(options) {
|
|
18854
|
+
return new this(options);
|
|
18855
|
+
}
|
|
18856
|
+
/**
|
|
18857
|
+
* Clear the cache.
|
|
18858
|
+
*/
|
|
18859
|
+
clearCache() {
|
|
18860
|
+
this.cache.clean();
|
|
18861
|
+
}
|
|
18862
|
+
setRequestTransform(requestTransform) {
|
|
18863
|
+
this.requestTransform = requestTransform;
|
|
18864
|
+
}
|
|
18865
|
+
/**
|
|
18866
|
+
* Fast way to specify the connection address to NextGIS Web.
|
|
18867
|
+
* The current connection will be severed.
|
|
18868
|
+
* @param baseUrl - NGW url
|
|
18869
|
+
*/
|
|
18870
|
+
setNgw(baseUrl) {
|
|
18871
|
+
this.logout();
|
|
18872
|
+
this.options.baseUrl = baseUrl;
|
|
18873
|
+
addConnector(this);
|
|
18874
|
+
}
|
|
18875
|
+
/**
|
|
18876
|
+
* Establishing a connection with NextGIS Web to fulfill all other requests.
|
|
18877
|
+
* @remarks
|
|
18878
|
+
* This method need not be called manually as it is used when forming a request in {@link apiRequest | apiRequest}.
|
|
18879
|
+
* Can be used to check connection.
|
|
18880
|
+
* @example
|
|
18881
|
+
* ```javascript
|
|
18882
|
+
* const connector = new NgwConnector({ baseUrl: 'https://demo.nextgis.com' });
|
|
18883
|
+
* connector.connect()
|
|
18884
|
+
* .then(() => console.log('Ok'))
|
|
18885
|
+
* .catch((er) => console.log('Connection problem', er));
|
|
18886
|
+
* ```
|
|
18887
|
+
*/
|
|
18888
|
+
connect() {
|
|
18889
|
+
return __async$r(this, null, function* () {
|
|
18890
|
+
const auth = this.options.auth;
|
|
18891
|
+
if (auth) {
|
|
18892
|
+
const { login, password } = auth;
|
|
18893
|
+
if (login && password) {
|
|
18894
|
+
yield this._login({ login, password });
|
|
18895
|
+
}
|
|
18896
|
+
}
|
|
18897
|
+
const routeUrl = `${this.routeStr}?client=${this.client}`;
|
|
18898
|
+
return yield this.makeQuery(
|
|
18899
|
+
routeUrl,
|
|
18900
|
+
{},
|
|
18901
|
+
{
|
|
18902
|
+
cacheName: "route",
|
|
18903
|
+
cache: true,
|
|
18904
|
+
cacheProps: {
|
|
18905
|
+
id: this.id,
|
|
18906
|
+
auth,
|
|
18907
|
+
baseUrl: this.options.baseUrl
|
|
18908
|
+
}
|
|
18909
|
+
}
|
|
18910
|
+
);
|
|
18911
|
+
});
|
|
18912
|
+
}
|
|
18913
|
+
/**
|
|
18914
|
+
* Quick way to change NextGIS Web user.
|
|
18915
|
+
* @param credentials - New user credentials
|
|
18916
|
+
*/
|
|
18917
|
+
login(credentials, options) {
|
|
18918
|
+
this.logout();
|
|
18919
|
+
addConnector(this);
|
|
18920
|
+
return this._login(credentials, options);
|
|
18921
|
+
}
|
|
18922
|
+
/**
|
|
18923
|
+
* Disconnecting a user. Aborting all current requests
|
|
18924
|
+
*/
|
|
18925
|
+
logout() {
|
|
18926
|
+
this.abort();
|
|
18927
|
+
removeConnector(this);
|
|
18928
|
+
this.options.auth = void 0;
|
|
18929
|
+
this.user = void 0;
|
|
18930
|
+
this.clearCache();
|
|
18931
|
+
this.emitter.emit("logout");
|
|
18932
|
+
}
|
|
18933
|
+
getUserInfo(credentials, options) {
|
|
18934
|
+
return __async$r(this, null, function* () {
|
|
18935
|
+
if (this.user && this.user.id) {
|
|
18936
|
+
return this.user;
|
|
18937
|
+
}
|
|
18938
|
+
if (credentials) {
|
|
18939
|
+
this.options.auth = credentials;
|
|
18940
|
+
}
|
|
18941
|
+
const options_ = __spreadValues$s({
|
|
18942
|
+
headers: this.getAuthorizationHeaders(credentials),
|
|
18943
|
+
cache: true
|
|
18944
|
+
}, options);
|
|
18945
|
+
return this.makeQuery(
|
|
18946
|
+
"/api/component/auth/current_user",
|
|
18947
|
+
{},
|
|
18948
|
+
options_
|
|
18949
|
+
);
|
|
18950
|
+
});
|
|
18951
|
+
}
|
|
18952
|
+
/**
|
|
18953
|
+
* Obtaining the required Headers for authentication of requests in the NGW.
|
|
18954
|
+
*/
|
|
18955
|
+
getAuthorizationHeaders(credentials) {
|
|
18956
|
+
const client = this.makeClientId(credentials);
|
|
18957
|
+
if (client) {
|
|
18958
|
+
return {
|
|
18959
|
+
Authorization: `Basic ${client}`
|
|
18960
|
+
};
|
|
18961
|
+
}
|
|
18962
|
+
return {};
|
|
18963
|
+
}
|
|
18964
|
+
makeClientId(credentials) {
|
|
18965
|
+
credentials = credentials || this.options.auth;
|
|
18966
|
+
if (credentials) {
|
|
18967
|
+
const { login, password } = credentials;
|
|
18968
|
+
const encodedStr = [login, password].map(encodeURIComponent).join(":");
|
|
18969
|
+
{
|
|
18970
|
+
return window.btoa(encodedStr);
|
|
18971
|
+
}
|
|
18972
|
+
}
|
|
18973
|
+
}
|
|
18974
|
+
/** Stop all api requests */
|
|
18975
|
+
abort() {
|
|
18976
|
+
for (const abortController of Object.values(this.activeRequests)) {
|
|
18977
|
+
abortController.abort();
|
|
18978
|
+
}
|
|
18979
|
+
this.activeRequests = {};
|
|
18980
|
+
}
|
|
18981
|
+
getActiveApiRequests() {
|
|
18982
|
+
return __spreadValues$s({}, this.activeRequests);
|
|
18983
|
+
}
|
|
18984
|
+
route(name, ...rest) {
|
|
18985
|
+
return route(name, this, ...rest);
|
|
18986
|
+
}
|
|
18987
|
+
/**
|
|
18988
|
+
* Send request to NGW.
|
|
18989
|
+
* @param url - URL address to NGW
|
|
18990
|
+
* @param params - Query params
|
|
18991
|
+
* @param options - Request options
|
|
18992
|
+
*/
|
|
18993
|
+
makeQuery(_0, _1) {
|
|
18994
|
+
return __async$r(this, arguments, function* (url, params, options = {}) {
|
|
18995
|
+
var _b;
|
|
18996
|
+
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
18997
|
+
if (!url) {
|
|
18998
|
+
throw new Error("Empty `url` not allowed");
|
|
18999
|
+
}
|
|
19000
|
+
if (params) {
|
|
19001
|
+
const _a = params, restParams = __objRest$3(_a, ["paramList"]);
|
|
19002
|
+
url = template(url, restParams);
|
|
19003
|
+
}
|
|
19004
|
+
url = encodeURI(fixUrlStr(url));
|
|
19005
|
+
options = __spreadValues$s({ withCredentials: this.withCredentials }, options);
|
|
19006
|
+
const {
|
|
19007
|
+
cache,
|
|
19008
|
+
signal: externalSignal,
|
|
19009
|
+
method = "GET",
|
|
19010
|
+
headers,
|
|
19011
|
+
cacheName,
|
|
19012
|
+
cacheProps,
|
|
19013
|
+
responseType,
|
|
19014
|
+
withCredentials
|
|
19015
|
+
} = options;
|
|
19016
|
+
const internalAbortController = new AbortController();
|
|
19017
|
+
const internalSignal = internalAbortController.signal;
|
|
19018
|
+
if (externalSignal) {
|
|
19019
|
+
if (externalSignal.aborted) {
|
|
19020
|
+
throw new AbortError();
|
|
19021
|
+
}
|
|
19022
|
+
externalSignal.addEventListener("abort", () => {
|
|
19023
|
+
internalAbortController.abort();
|
|
19024
|
+
});
|
|
19025
|
+
}
|
|
19026
|
+
options.signal = internalSignal;
|
|
19027
|
+
const createPromise = () => __async$r(this, null, function* () {
|
|
19028
|
+
const id = REQUEST_ID++;
|
|
19029
|
+
this.activeRequests[id] = internalAbortController;
|
|
19030
|
+
try {
|
|
19031
|
+
return this._loadData(url, options);
|
|
19032
|
+
} finally {
|
|
19033
|
+
this._cleanActiveRequest(id);
|
|
19034
|
+
}
|
|
19035
|
+
});
|
|
19036
|
+
if (cache && method === "GET") {
|
|
19037
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$h(__spreadValues$s({}, objectRemoveEmpty({
|
|
19038
|
+
headers,
|
|
19039
|
+
withCredentials,
|
|
19040
|
+
responseType,
|
|
19041
|
+
baseUrl: this.options.baseUrl,
|
|
19042
|
+
userId: (_b = this.user) == null ? void 0 : _b.id
|
|
19043
|
+
})), {
|
|
19044
|
+
params
|
|
19045
|
+
});
|
|
19046
|
+
return this.cache.add(
|
|
19047
|
+
cacheName || url,
|
|
19048
|
+
createPromise,
|
|
19049
|
+
cacheOptions,
|
|
19050
|
+
false
|
|
19051
|
+
);
|
|
19052
|
+
}
|
|
19053
|
+
return createPromise();
|
|
19054
|
+
});
|
|
19055
|
+
}
|
|
19056
|
+
_loadData(url, options) {
|
|
19057
|
+
options.responseType = options.responseType || "json";
|
|
19058
|
+
return new Promise((resolve, reject) => {
|
|
19059
|
+
var _a;
|
|
19060
|
+
if (this.user) {
|
|
19061
|
+
options = options || {};
|
|
19062
|
+
options.headers = __spreadValues$s(__spreadValues$s({}, this.getAuthorizationHeaders()), options.headers);
|
|
19063
|
+
}
|
|
19064
|
+
if (this.requestTransform) {
|
|
19065
|
+
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
19066
|
+
url = transUrl;
|
|
19067
|
+
options = transOptions;
|
|
19068
|
+
}
|
|
19069
|
+
let runOnAbort = void 0;
|
|
19070
|
+
loadData(url, resolve, options, reject, (handler) => {
|
|
19071
|
+
runOnAbort = handler;
|
|
19072
|
+
});
|
|
19073
|
+
(_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
|
|
19074
|
+
if (runOnAbort !== void 0) {
|
|
19075
|
+
runOnAbort();
|
|
19076
|
+
}
|
|
19077
|
+
reject(new AbortError());
|
|
19078
|
+
});
|
|
19079
|
+
}).catch((httpError) => {
|
|
19080
|
+
if (httpError.name !== "AbortError") {
|
|
19081
|
+
{
|
|
19082
|
+
console.warn("DEV WARN", httpError);
|
|
19083
|
+
}
|
|
19084
|
+
const er = this._handleHttpError(httpError);
|
|
19085
|
+
if (er) {
|
|
19086
|
+
throw er;
|
|
19087
|
+
}
|
|
19088
|
+
}
|
|
19089
|
+
throw httpError;
|
|
19090
|
+
});
|
|
19091
|
+
}
|
|
19092
|
+
_login(credentials, options) {
|
|
19093
|
+
return __async$r(this, null, function* () {
|
|
19094
|
+
try {
|
|
19095
|
+
const data = yield this.getUserInfo(credentials, options);
|
|
19096
|
+
this.user = data;
|
|
19097
|
+
this.emitter.emit("login", data);
|
|
19098
|
+
return data;
|
|
19099
|
+
} catch (er) {
|
|
19100
|
+
this.emitter.emit("login:error", er);
|
|
19101
|
+
throw er;
|
|
19102
|
+
}
|
|
19103
|
+
});
|
|
19104
|
+
}
|
|
19105
|
+
_cleanActiveRequest(requestId) {
|
|
19106
|
+
delete this.activeRequests[requestId];
|
|
19107
|
+
}
|
|
19108
|
+
_handleHttpError(er) {
|
|
19109
|
+
if (er) {
|
|
19110
|
+
if (er instanceof NgwError) {
|
|
19111
|
+
if (er.exception === "nextgisweb.resource.exception.ResourceNotFound") {
|
|
19112
|
+
throw new ResourceNotFoundError(er);
|
|
19113
|
+
} else if (er.exception === "nextgisweb.core.exception.InsufficientPermissions") {
|
|
19114
|
+
throw new InsufficientPermissionsError(er);
|
|
19115
|
+
}
|
|
19116
|
+
}
|
|
19117
|
+
}
|
|
19118
|
+
return er;
|
|
19119
|
+
}
|
|
19120
|
+
}
|
|
19121
|
+
__publicField$s(NgwConnector, "errors", {
|
|
19122
|
+
NgwError,
|
|
19123
|
+
ResourceNotFoundError
|
|
19124
|
+
});
|
|
19125
|
+
|
|
19126
|
+
function resourceCompare(res1, res2) {
|
|
19127
|
+
return objectDeepEqual(res1, res2);
|
|
19128
|
+
}
|
|
19129
|
+
|
|
19130
|
+
const exclude = ["description"];
|
|
19131
|
+
function resourceToQuery(resource, prefix = "") {
|
|
19132
|
+
prefix = prefix ? prefix + "__" : "";
|
|
19133
|
+
const query = {};
|
|
19134
|
+
for (const [key, value] of Object.entries(resource)) {
|
|
19135
|
+
if (exclude.indexOf(key) === -1) {
|
|
19136
|
+
if (isObject(value)) {
|
|
19137
|
+
if (key === "owner_user") {
|
|
19138
|
+
const children = resourceToQuery(value, key);
|
|
19139
|
+
Object.assign(query, children);
|
|
19140
|
+
} else if (key === "parent" && "id" in value) {
|
|
19141
|
+
query.parent_id = value.id;
|
|
19142
|
+
}
|
|
19143
|
+
} else if (defined(value)) {
|
|
19144
|
+
query[prefix + key] = value;
|
|
19145
|
+
}
|
|
19146
|
+
}
|
|
19147
|
+
}
|
|
19148
|
+
return query;
|
|
19149
|
+
}
|
|
19150
|
+
|
|
19151
|
+
var __defProp$D = Object.defineProperty;
|
|
19152
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
19153
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
19154
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
19155
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19156
|
+
var __spreadValues$r = (a, b) => {
|
|
19157
|
+
for (var prop in b || (b = {}))
|
|
19158
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
19159
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
19160
|
+
if (__getOwnPropSymbols$s)
|
|
19161
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
19162
|
+
if (__propIsEnum$s.call(b, prop))
|
|
19163
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
19164
|
+
}
|
|
19165
|
+
return a;
|
|
19166
|
+
};
|
|
19167
|
+
var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19168
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
19169
|
+
return new Promise((resolve, reject) => {
|
|
19170
|
+
var fulfilled = (value) => {
|
|
19171
|
+
try {
|
|
19172
|
+
step(generator.next(value));
|
|
19173
|
+
} catch (e) {
|
|
19174
|
+
reject(e);
|
|
19175
|
+
}
|
|
19176
|
+
};
|
|
19177
|
+
var rejected = (value) => {
|
|
19178
|
+
try {
|
|
19179
|
+
step(generator.throw(value));
|
|
19180
|
+
} catch (e) {
|
|
19181
|
+
reject(e);
|
|
19182
|
+
}
|
|
19183
|
+
};
|
|
19184
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19185
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19186
|
+
});
|
|
19187
|
+
};
|
|
19188
|
+
class ResourcesControl {
|
|
19189
|
+
constructor({
|
|
19190
|
+
connector,
|
|
19191
|
+
cacheId
|
|
19192
|
+
}) {
|
|
19193
|
+
__publicField$r(this, "cache");
|
|
19194
|
+
__publicField$r(this, "connector");
|
|
19195
|
+
this.connector = connector;
|
|
19196
|
+
this.cache = new Cache({ namespace: cacheId });
|
|
19197
|
+
}
|
|
19198
|
+
// -------------------------------------------------------------------------
|
|
19199
|
+
// Resource Methods
|
|
19200
|
+
// -------------------------------------------------------------------------
|
|
19201
|
+
/**
|
|
19202
|
+
* Receive resource from NGW by id, keyname or search-object parameter.
|
|
19203
|
+
* @param resource - Resource id, keyname or search-object
|
|
19204
|
+
*
|
|
19205
|
+
* @remarks
|
|
19206
|
+
* Fetching resource would be cached to speed up next call
|
|
19207
|
+
*/
|
|
19208
|
+
getOne(resource, requestOptions) {
|
|
19209
|
+
const opt = __spreadValues$r({}, requestOptions);
|
|
19210
|
+
if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
|
|
19211
|
+
if (resource.id !== void 0) {
|
|
19212
|
+
resource.id;
|
|
19213
|
+
} else {
|
|
19214
|
+
if (resource.keyname) {
|
|
19215
|
+
resource.keyname;
|
|
19216
|
+
}
|
|
19217
|
+
if (resource.display_name) {
|
|
19218
|
+
resource.display_name;
|
|
19219
|
+
}
|
|
19220
|
+
}
|
|
19221
|
+
}
|
|
19222
|
+
if (typeof resource === "string") {
|
|
19223
|
+
return this._fetchResourceBy({ keyname: resource }, opt);
|
|
19224
|
+
} else if (typeof resource === "number") {
|
|
19225
|
+
return this._fetchResourceById(resource, opt);
|
|
19226
|
+
} else if (isObject(resource)) {
|
|
19227
|
+
return this._fetchResourceBy(resource, opt);
|
|
19228
|
+
}
|
|
19229
|
+
return Promise.resolve(void 0);
|
|
19230
|
+
}
|
|
19231
|
+
getOneOrFail(resource, requestOptions) {
|
|
19232
|
+
return this.getOne(resource, requestOptions).then((res) => {
|
|
18263
19233
|
if (res) {
|
|
18264
19234
|
return res;
|
|
18265
19235
|
}
|
|
@@ -18313,7 +19283,7 @@ var NgwLeaflet = (function () {
|
|
|
18313
19283
|
} else {
|
|
18314
19284
|
Object.assign(query, resourceToQuery(resource));
|
|
18315
19285
|
}
|
|
18316
|
-
return this.connector.get("resource.search", requestOptions, __spreadValues$
|
|
19286
|
+
return this.connector.get("resource.search", requestOptions, __spreadValues$r({
|
|
18317
19287
|
serialization: "full"
|
|
18318
19288
|
}, query)).then((resources) => {
|
|
18319
19289
|
if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
|
|
@@ -18390,7 +19360,7 @@ var NgwLeaflet = (function () {
|
|
|
18390
19360
|
});
|
|
18391
19361
|
}
|
|
18392
19362
|
_cleanResourceItemCache(id) {
|
|
18393
|
-
return __async$
|
|
19363
|
+
return __async$q(this, null, function* () {
|
|
18394
19364
|
var _a;
|
|
18395
19365
|
const all = this.cache.all();
|
|
18396
19366
|
const toDelete = [];
|
|
@@ -18409,310 +19379,56 @@ var NgwLeaflet = (function () {
|
|
|
18409
19379
|
}
|
|
18410
19380
|
}
|
|
18411
19381
|
}
|
|
18412
|
-
for (const d of toDelete) {
|
|
18413
|
-
this.cache.delete(d);
|
|
18414
|
-
}
|
|
18415
|
-
});
|
|
18416
|
-
}
|
|
18417
|
-
_fetchResourceById(id, requestOptions) {
|
|
18418
|
-
return this.connector.get("resource.item", requestOptions, { id });
|
|
18419
|
-
}
|
|
18420
|
-
_fetchResourceBy(resource, requestOptions) {
|
|
18421
|
-
return this.getMany(resource, requestOptions).then((resources) => {
|
|
18422
|
-
return resources[0];
|
|
18423
|
-
});
|
|
18424
|
-
}
|
|
18425
|
-
_resourceCacheFilter(resource) {
|
|
18426
|
-
return Promise.all(this.cache.matchAll("resource.item")).then(
|
|
18427
|
-
(resources) => {
|
|
18428
|
-
const items = [];
|
|
18429
|
-
resources.filter((x) => {
|
|
18430
|
-
if (x) {
|
|
18431
|
-
if (resource.keyname && x.resource.keyname) {
|
|
18432
|
-
return resource.keyname === x.resource.keyname;
|
|
18433
|
-
}
|
|
18434
|
-
if (defined(resource.id) && defined(x.resource.id)) {
|
|
18435
|
-
return resource.id === x.resource.id;
|
|
18436
|
-
}
|
|
18437
|
-
return resourceCompare(resource, x.resource);
|
|
18438
|
-
}
|
|
18439
|
-
});
|
|
18440
|
-
return items;
|
|
18441
|
-
}
|
|
18442
|
-
);
|
|
18443
|
-
}
|
|
18444
|
-
}
|
|
18445
|
-
|
|
18446
|
-
const CONNECTORS = [];
|
|
18447
|
-
function addConnector(connector) {
|
|
18448
|
-
CONNECTORS.push(connector);
|
|
18449
|
-
}
|
|
18450
|
-
function findConnector(options) {
|
|
18451
|
-
return CONNECTORS.find((x) => {
|
|
18452
|
-
if (x.options.baseUrl === options.baseUrl) {
|
|
18453
|
-
if (options.auth) {
|
|
18454
|
-
if (x.options.auth) {
|
|
18455
|
-
return objectDeepEqual(x.options.auth, options.auth);
|
|
18456
|
-
}
|
|
18457
|
-
} else {
|
|
18458
|
-
return true;
|
|
18459
|
-
}
|
|
18460
|
-
}
|
|
18461
|
-
});
|
|
18462
|
-
}
|
|
18463
|
-
function removeConnector(connector) {
|
|
18464
|
-
const index = CONNECTORS.indexOf(connector);
|
|
18465
|
-
if (index !== -1) {
|
|
18466
|
-
CONNECTORS.splice(index, 1);
|
|
18467
|
-
}
|
|
18468
|
-
}
|
|
18469
|
-
|
|
18470
|
-
class AbortError extends Error {
|
|
18471
|
-
constructor(message = "AbortError") {
|
|
18472
|
-
super(message);
|
|
18473
|
-
this.name = "AbortError";
|
|
18474
|
-
}
|
|
18475
|
-
}
|
|
18476
|
-
|
|
18477
|
-
var __defProp$D = Object.defineProperty;
|
|
18478
|
-
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18479
|
-
var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18480
|
-
class InsufficientPermissionsError extends NgwError {
|
|
18481
|
-
constructor(obj) {
|
|
18482
|
-
super(obj);
|
|
18483
|
-
__publicField$r(this, "name", "InsufficientPermissionsError");
|
|
18484
|
-
__publicField$r(this, "exception", "nextgisweb.core.exception.InsufficientPermissions");
|
|
18485
|
-
Object.setPrototypeOf(this, InsufficientPermissionsError.prototype);
|
|
18486
|
-
}
|
|
18487
|
-
}
|
|
18488
|
-
|
|
18489
|
-
const templateRe = /\{ *([\w_-]+) *\}/g;
|
|
18490
|
-
function template(str, data) {
|
|
18491
|
-
return str.replace(templateRe, (s, key) => {
|
|
18492
|
-
let value = data[key];
|
|
18493
|
-
if (value === void 0) {
|
|
18494
|
-
throw new Error("No value provided for letiable " + s);
|
|
18495
|
-
} else if (typeof value === "function") {
|
|
18496
|
-
value = value(data);
|
|
18497
|
-
}
|
|
18498
|
-
return value;
|
|
18499
|
-
});
|
|
18500
|
-
}
|
|
18501
|
-
|
|
18502
|
-
var __defProp$C = Object.defineProperty;
|
|
18503
|
-
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
18504
|
-
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
18505
|
-
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
18506
|
-
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18507
|
-
var __spreadValues$r = (a, b) => {
|
|
18508
|
-
for (var prop in b || (b = {}))
|
|
18509
|
-
if (__hasOwnProp$s.call(b, prop))
|
|
18510
|
-
__defNormalProp$C(a, prop, b[prop]);
|
|
18511
|
-
if (__getOwnPropSymbols$s)
|
|
18512
|
-
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
18513
|
-
if (__propIsEnum$s.call(b, prop))
|
|
18514
|
-
__defNormalProp$C(a, prop, b[prop]);
|
|
18515
|
-
}
|
|
18516
|
-
return a;
|
|
18517
|
-
};
|
|
18518
|
-
var __async$q = (__this, __arguments, generator) => {
|
|
18519
|
-
return new Promise((resolve, reject) => {
|
|
18520
|
-
var fulfilled = (value) => {
|
|
18521
|
-
try {
|
|
18522
|
-
step(generator.next(value));
|
|
18523
|
-
} catch (e) {
|
|
18524
|
-
reject(e);
|
|
18525
|
-
}
|
|
18526
|
-
};
|
|
18527
|
-
var rejected = (value) => {
|
|
18528
|
-
try {
|
|
18529
|
-
step(generator.throw(value));
|
|
18530
|
-
} catch (e) {
|
|
18531
|
-
reject(e);
|
|
18532
|
-
}
|
|
18533
|
-
};
|
|
18534
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18535
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
18536
|
-
});
|
|
18537
|
-
};
|
|
18538
|
-
function apiRequest(opt) {
|
|
18539
|
-
return __async$q(this, null, function* () {
|
|
18540
|
-
const { params, name, connector, requestOptions } = opt;
|
|
18541
|
-
const apiItems = yield connector.connect();
|
|
18542
|
-
let apiItem = apiItems && apiItems[name];
|
|
18543
|
-
if (apiItem) {
|
|
18544
|
-
apiItem = [...apiItem];
|
|
18545
|
-
let url = apiItem.shift();
|
|
18546
|
-
if (apiItem.length) {
|
|
18547
|
-
const replaceParams = {};
|
|
18548
|
-
for (let fry = 0; fry < apiItem.length; fry++) {
|
|
18549
|
-
const arg = apiItem[fry];
|
|
18550
|
-
replaceParams[fry] = `{${arg}}`;
|
|
18551
|
-
if (params[arg] === void 0) {
|
|
18552
|
-
throw new Error(`\`${arg}\` URL API argument is not specified`);
|
|
18553
|
-
}
|
|
18554
|
-
}
|
|
18555
|
-
if (url) {
|
|
18556
|
-
url = template(url, replaceParams);
|
|
18557
|
-
}
|
|
18558
|
-
}
|
|
18559
|
-
if (params) {
|
|
18560
|
-
const paramArray = [];
|
|
18561
|
-
const paramList = params.paramList;
|
|
18562
|
-
if (Array.isArray(paramList)) {
|
|
18563
|
-
paramList.forEach(([key, value]) => {
|
|
18564
|
-
paramArray.push(`${key}=${value}`);
|
|
18565
|
-
});
|
|
18566
|
-
}
|
|
18567
|
-
for (const p in params) {
|
|
18568
|
-
if (apiItem.indexOf(p) === -1) {
|
|
18569
|
-
paramArray.push(`${p}=${params[p]}`);
|
|
18570
|
-
}
|
|
18571
|
-
}
|
|
18572
|
-
if (paramArray.length) {
|
|
18573
|
-
url = `${url}?${paramArray.join("&")}`;
|
|
18574
|
-
}
|
|
18575
|
-
}
|
|
18576
|
-
if (url) {
|
|
18577
|
-
return connector.makeQuery(url, params, __spreadValues$r({
|
|
18578
|
-
cacheName: name
|
|
18579
|
-
}, requestOptions));
|
|
18580
|
-
} else {
|
|
18581
|
-
throw new Error("Request URL is not set");
|
|
18582
|
-
}
|
|
18583
|
-
} else {
|
|
18584
|
-
return void 0;
|
|
18585
|
-
}
|
|
18586
|
-
});
|
|
18587
|
-
}
|
|
18588
|
-
|
|
18589
|
-
var __defProp$B = Object.defineProperty;
|
|
18590
|
-
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18591
|
-
var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, key + "" , value);
|
|
18592
|
-
class NetworkError extends Error {
|
|
18593
|
-
constructor(url) {
|
|
18594
|
-
super();
|
|
18595
|
-
__publicField$q(this, "name", "NetworkError");
|
|
18596
|
-
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
18597
|
-
this.message = `Unable to request ${url}.
|
|
18598
|
-
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
18599
|
-
}
|
|
18600
|
-
}
|
|
18601
|
-
|
|
18602
|
-
let loadData;
|
|
18603
|
-
{
|
|
18604
|
-
loadData = (url, callback, options = {}, error, onCancel) => {
|
|
18605
|
-
options.method = options.method || "GET";
|
|
18606
|
-
const xhr = new XMLHttpRequest();
|
|
18607
|
-
xhr.open(options.method || "GET", url, true);
|
|
18608
|
-
if (options.responseType === "blob") {
|
|
18609
|
-
xhr.responseType = options.responseType;
|
|
18610
|
-
}
|
|
18611
|
-
const getResponseText = () => {
|
|
18612
|
-
try {
|
|
18613
|
-
return JSON.parse(xhr.responseText);
|
|
18614
|
-
} catch (er) {
|
|
18615
|
-
return xhr.responseText;
|
|
18616
|
-
}
|
|
18617
|
-
};
|
|
18618
|
-
const processingResponse = (forError = false) => {
|
|
18619
|
-
const cb = forError ? error : callback;
|
|
18620
|
-
if (options.responseType === "blob") {
|
|
18621
|
-
cb(xhr.response);
|
|
18622
|
-
} else {
|
|
18623
|
-
if (xhr.responseText) {
|
|
18624
|
-
cb(getResponseText());
|
|
18625
|
-
} else {
|
|
18626
|
-
error({ message: "" });
|
|
18627
|
-
}
|
|
18628
|
-
}
|
|
18629
|
-
};
|
|
18630
|
-
xhr.onload = () => {
|
|
18631
|
-
if ([401, 403, 404, 422, 500].indexOf(xhr.status) !== -1) {
|
|
18632
|
-
error(new NgwError(getResponseText()));
|
|
18633
|
-
}
|
|
18634
|
-
processingResponse();
|
|
18635
|
-
};
|
|
18636
|
-
xhr.onerror = (er) => {
|
|
18637
|
-
if (xhr.status === 0) {
|
|
18638
|
-
error(new NetworkError(url));
|
|
18639
|
-
} else {
|
|
18640
|
-
error(er);
|
|
18641
|
-
}
|
|
18642
|
-
};
|
|
18643
|
-
xhr.upload.onprogress = function(e) {
|
|
18644
|
-
if (e.lengthComputable) {
|
|
18645
|
-
const percentComplete = e.loaded / e.total * 100;
|
|
18646
|
-
if (options.onProgress) {
|
|
18647
|
-
options.onProgress(percentComplete, e);
|
|
18648
|
-
}
|
|
18649
|
-
}
|
|
18650
|
-
};
|
|
18651
|
-
const headers = options.headers;
|
|
18652
|
-
if (headers) {
|
|
18653
|
-
for (const h in headers) {
|
|
18654
|
-
const header = headers[h];
|
|
18655
|
-
if (typeof header === "string") {
|
|
18656
|
-
xhr.setRequestHeader(h, header);
|
|
18657
|
-
}
|
|
18658
|
-
}
|
|
18659
|
-
}
|
|
18660
|
-
if (options.withCredentials !== void 0) {
|
|
18661
|
-
xhr.withCredentials = options.withCredentials;
|
|
18662
|
-
}
|
|
18663
|
-
let data;
|
|
18664
|
-
if (options.file) {
|
|
18665
|
-
data = new FormData();
|
|
18666
|
-
data.append("file", options.file);
|
|
18667
|
-
if (options.data) {
|
|
18668
|
-
for (const d in options.data) {
|
|
18669
|
-
data.append(d, data[d]);
|
|
18670
|
-
}
|
|
19382
|
+
for (const d of toDelete) {
|
|
19383
|
+
this.cache.delete(d);
|
|
18671
19384
|
}
|
|
18672
|
-
}
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
}
|
|
19385
|
+
});
|
|
19386
|
+
}
|
|
19387
|
+
_fetchResourceById(id, requestOptions) {
|
|
19388
|
+
return this.connector.get("resource.item", requestOptions, { id });
|
|
19389
|
+
}
|
|
19390
|
+
_fetchResourceBy(resource, requestOptions) {
|
|
19391
|
+
return this.getMany(resource, requestOptions).then((resources) => {
|
|
19392
|
+
return resources[0];
|
|
19393
|
+
});
|
|
19394
|
+
}
|
|
19395
|
+
_resourceCacheFilter(resource) {
|
|
19396
|
+
return Promise.all(this.cache.matchAll("resource.item")).then(
|
|
19397
|
+
(resources) => {
|
|
19398
|
+
const items = [];
|
|
19399
|
+
resources.filter((x) => {
|
|
19400
|
+
if (x) {
|
|
19401
|
+
if (resource.keyname && x.resource.keyname) {
|
|
19402
|
+
return resource.keyname === x.resource.keyname;
|
|
19403
|
+
}
|
|
19404
|
+
if (defined(resource.id) && defined(x.resource.id)) {
|
|
19405
|
+
return resource.id === x.resource.id;
|
|
19406
|
+
}
|
|
19407
|
+
return resourceCompare(resource, x.resource);
|
|
19408
|
+
}
|
|
19409
|
+
});
|
|
19410
|
+
return items;
|
|
19411
|
+
}
|
|
19412
|
+
);
|
|
19413
|
+
}
|
|
18682
19414
|
}
|
|
18683
19415
|
|
|
18684
|
-
var __defProp$
|
|
18685
|
-
var __defProps$g = Object.defineProperties;
|
|
18686
|
-
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
19416
|
+
var __defProp$C = Object.defineProperty;
|
|
18687
19417
|
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
18688
19418
|
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
18689
19419
|
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
18690
|
-
var __defNormalProp$
|
|
19420
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18691
19421
|
var __spreadValues$q = (a, b) => {
|
|
18692
19422
|
for (var prop in b || (b = {}))
|
|
18693
19423
|
if (__hasOwnProp$r.call(b, prop))
|
|
18694
|
-
__defNormalProp$
|
|
19424
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
18695
19425
|
if (__getOwnPropSymbols$r)
|
|
18696
19426
|
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
18697
19427
|
if (__propIsEnum$r.call(b, prop))
|
|
18698
|
-
__defNormalProp$
|
|
19428
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
18699
19429
|
}
|
|
18700
19430
|
return a;
|
|
18701
19431
|
};
|
|
18702
|
-
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
18703
|
-
var __objRest$2 = (source, exclude) => {
|
|
18704
|
-
var target = {};
|
|
18705
|
-
for (var prop in source)
|
|
18706
|
-
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
18707
|
-
target[prop] = source[prop];
|
|
18708
|
-
if (source != null && __getOwnPropSymbols$r)
|
|
18709
|
-
for (var prop of __getOwnPropSymbols$r(source)) {
|
|
18710
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
|
18711
|
-
target[prop] = source[prop];
|
|
18712
|
-
}
|
|
18713
|
-
return target;
|
|
18714
|
-
};
|
|
18715
|
-
var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18716
19432
|
var __async$p = (__this, __arguments, generator) => {
|
|
18717
19433
|
return new Promise((resolve, reject) => {
|
|
18718
19434
|
var fulfilled = (value) => {
|
|
@@ -18733,172 +19449,76 @@ var NgwLeaflet = (function () {
|
|
|
18733
19449
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
18734
19450
|
});
|
|
18735
19451
|
};
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
} else {
|
|
18756
|
-
const { route, requestTransform, withCredentials } = this.options;
|
|
18757
|
-
if (route) {
|
|
18758
|
-
this.routeStr = route;
|
|
18759
|
-
}
|
|
18760
|
-
if (requestTransform) {
|
|
18761
|
-
this.requestTransform = requestTransform;
|
|
18762
|
-
}
|
|
18763
|
-
if (withCredentials !== void 0) {
|
|
18764
|
-
this.withCredentials = withCredentials;
|
|
18765
|
-
}
|
|
18766
|
-
this.resources = new ResourcesControl({
|
|
18767
|
-
connector: this,
|
|
18768
|
-
cacheId: options.cacheId
|
|
18769
|
-
});
|
|
18770
|
-
addConnector(this);
|
|
18771
|
-
}
|
|
18772
|
-
}
|
|
18773
|
-
static create(options) {
|
|
18774
|
-
return new this(options);
|
|
18775
|
-
}
|
|
18776
|
-
/**
|
|
18777
|
-
* Clear the cache.
|
|
18778
|
-
*/
|
|
18779
|
-
clearCache() {
|
|
18780
|
-
this.cache.clean();
|
|
18781
|
-
this.resources.cache.clean();
|
|
18782
|
-
}
|
|
18783
|
-
setRequestTransform(requestTransform) {
|
|
18784
|
-
this.requestTransform = requestTransform;
|
|
18785
|
-
}
|
|
18786
|
-
/**
|
|
18787
|
-
* Fast way to specify the connection address to NextGIS Web.
|
|
18788
|
-
* The current connection will be severed.
|
|
18789
|
-
* @param baseUrl - NGW url
|
|
18790
|
-
*/
|
|
18791
|
-
setNgw(baseUrl) {
|
|
18792
|
-
this.logout();
|
|
18793
|
-
this.options.baseUrl = baseUrl;
|
|
18794
|
-
addConnector(this);
|
|
18795
|
-
}
|
|
18796
|
-
/**
|
|
18797
|
-
* Establishing a connection with NextGIS Web to fulfill all other requests.
|
|
18798
|
-
* @remarks
|
|
18799
|
-
* This method need not be called manually as it is used when forming a request in {@link apiRequest | apiRequest}.
|
|
18800
|
-
* Can be used to check connection.
|
|
18801
|
-
* @example
|
|
18802
|
-
* ```javascript
|
|
18803
|
-
* const connector = new NgwConnector({baseUrl: 'https://demo.nextgis.com'});
|
|
18804
|
-
* connector.connect()
|
|
18805
|
-
* .then(() => console.log('Ok'))
|
|
18806
|
-
* .catch((er) => console.log('Connection problem', er));
|
|
18807
|
-
* ```
|
|
18808
|
-
*/
|
|
18809
|
-
connect() {
|
|
18810
|
-
return __async$p(this, null, function* () {
|
|
18811
|
-
const auth = this.options.auth;
|
|
18812
|
-
if (auth) {
|
|
18813
|
-
const { login, password } = auth;
|
|
18814
|
-
if (login && password) {
|
|
18815
|
-
yield this._login({ login, password });
|
|
19452
|
+
function apiRequest(opt) {
|
|
19453
|
+
return __async$p(this, null, function* () {
|
|
19454
|
+
const { params, name, connector, requestOptions } = opt;
|
|
19455
|
+
const apiItems = yield connector.connect();
|
|
19456
|
+
let apiItem = apiItems && apiItems[name];
|
|
19457
|
+
if (apiItem) {
|
|
19458
|
+
apiItem = [...apiItem];
|
|
19459
|
+
let url = apiItem.shift();
|
|
19460
|
+
if (apiItem.length) {
|
|
19461
|
+
const replaceParams = {};
|
|
19462
|
+
for (let fry = 0; fry < apiItem.length; fry++) {
|
|
19463
|
+
const arg = apiItem[fry];
|
|
19464
|
+
replaceParams[fry] = `{${arg}}`;
|
|
19465
|
+
if (params[arg] === void 0) {
|
|
19466
|
+
throw new Error(`\`${arg}\` URL API argument is not specified`);
|
|
19467
|
+
}
|
|
19468
|
+
}
|
|
19469
|
+
if (url) {
|
|
19470
|
+
url = template(url, replaceParams);
|
|
18816
19471
|
}
|
|
18817
19472
|
}
|
|
18818
|
-
|
|
18819
|
-
|
|
18820
|
-
|
|
18821
|
-
{
|
|
18822
|
-
|
|
18823
|
-
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18828
|
-
|
|
19473
|
+
if (params) {
|
|
19474
|
+
const paramArray = [];
|
|
19475
|
+
const paramList = params.paramList;
|
|
19476
|
+
if (Array.isArray(paramList)) {
|
|
19477
|
+
paramList.forEach(([key, value]) => {
|
|
19478
|
+
paramArray.push(`${key}=${value}`);
|
|
19479
|
+
});
|
|
19480
|
+
}
|
|
19481
|
+
for (const p in params) {
|
|
19482
|
+
if (apiItem.indexOf(p) === -1) {
|
|
19483
|
+
paramArray.push(`${p}=${params[p]}`);
|
|
18829
19484
|
}
|
|
18830
19485
|
}
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
/**
|
|
18835
|
-
* Quick way to change NextGIS Web user.
|
|
18836
|
-
* @param credentials - New user credentials
|
|
18837
|
-
*/
|
|
18838
|
-
login(credentials, options) {
|
|
18839
|
-
this.logout();
|
|
18840
|
-
addConnector(this);
|
|
18841
|
-
return this._login(credentials, options);
|
|
18842
|
-
}
|
|
18843
|
-
/**
|
|
18844
|
-
* Disconnecting a user. Aborting all current requests
|
|
18845
|
-
*/
|
|
18846
|
-
logout() {
|
|
18847
|
-
this.abort();
|
|
18848
|
-
removeConnector(this);
|
|
18849
|
-
this.options.auth = void 0;
|
|
18850
|
-
this.user = void 0;
|
|
18851
|
-
this.clearCache();
|
|
18852
|
-
this.emitter.emit("logout");
|
|
18853
|
-
}
|
|
18854
|
-
getUserInfo(credentials, options) {
|
|
18855
|
-
return __async$p(this, null, function* () {
|
|
18856
|
-
if (this.user && this.user.id) {
|
|
18857
|
-
return this.user;
|
|
19486
|
+
if (paramArray.length) {
|
|
19487
|
+
url = `${url}?${paramArray.join("&")}`;
|
|
19488
|
+
}
|
|
18858
19489
|
}
|
|
18859
|
-
if (
|
|
18860
|
-
|
|
19490
|
+
if (url) {
|
|
19491
|
+
return connector.makeQuery(url, params, __spreadValues$q({
|
|
19492
|
+
cacheName: name
|
|
19493
|
+
}, requestOptions));
|
|
19494
|
+
} else {
|
|
19495
|
+
throw new Error("Request URL is not set");
|
|
18861
19496
|
}
|
|
18862
|
-
|
|
18863
|
-
|
|
18864
|
-
|
|
18865
|
-
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
19497
|
+
} else {
|
|
19498
|
+
return void 0;
|
|
19499
|
+
}
|
|
19500
|
+
});
|
|
19501
|
+
}
|
|
19502
|
+
|
|
19503
|
+
var __defProp$B = Object.defineProperty;
|
|
19504
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19505
|
+
var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, key + "" , value);
|
|
19506
|
+
class NgwConnectorExtended extends NgwConnector {
|
|
19507
|
+
constructor(options) {
|
|
19508
|
+
super(options);
|
|
19509
|
+
this.options = options;
|
|
19510
|
+
__publicField$q(this, "resources");
|
|
19511
|
+
this.resources = new ResourcesControl({
|
|
19512
|
+
connector: this,
|
|
19513
|
+
cacheId: options.cacheId
|
|
18870
19514
|
});
|
|
18871
19515
|
}
|
|
18872
19516
|
/**
|
|
18873
|
-
*
|
|
18874
|
-
*/
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
return {
|
|
18879
|
-
Authorization: `Basic ${client}`
|
|
18880
|
-
};
|
|
18881
|
-
}
|
|
18882
|
-
}
|
|
18883
|
-
makeClientId(credentials) {
|
|
18884
|
-
credentials = credentials || this.options.auth;
|
|
18885
|
-
if (credentials) {
|
|
18886
|
-
const { login, password } = credentials;
|
|
18887
|
-
const encodedStr = [login, password].map(encodeURIComponent).join(":");
|
|
18888
|
-
{
|
|
18889
|
-
return window.btoa(encodedStr);
|
|
18890
|
-
}
|
|
18891
|
-
}
|
|
18892
|
-
}
|
|
18893
|
-
/** Stop all api requests */
|
|
18894
|
-
abort() {
|
|
18895
|
-
for (const abortController of Object.values(this.activeRequests)) {
|
|
18896
|
-
abortController.abort();
|
|
18897
|
-
}
|
|
18898
|
-
this.activeRequests = {};
|
|
18899
|
-
}
|
|
18900
|
-
getActiveApiRequests() {
|
|
18901
|
-
return __spreadValues$q({}, this.activeRequests);
|
|
19517
|
+
* Clear the cache.
|
|
19518
|
+
*/
|
|
19519
|
+
clearCache() {
|
|
19520
|
+
super.clearCache();
|
|
19521
|
+
this.resources.cache.clean();
|
|
18902
19522
|
}
|
|
18903
19523
|
/**
|
|
18904
19524
|
* Send request to NGW api router.
|
|
@@ -19017,75 +19637,6 @@ var NgwLeaflet = (function () {
|
|
|
19017
19637
|
options
|
|
19018
19638
|
);
|
|
19019
19639
|
}
|
|
19020
|
-
/**
|
|
19021
|
-
* Send request to NGW.
|
|
19022
|
-
* @param url - URL address to NGW
|
|
19023
|
-
* @param params - Query params
|
|
19024
|
-
* @param options - Request options
|
|
19025
|
-
*/
|
|
19026
|
-
makeQuery(_0, _1) {
|
|
19027
|
-
return __async$p(this, arguments, function* (url, params, options = {}) {
|
|
19028
|
-
var _b;
|
|
19029
|
-
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
19030
|
-
if (!url) {
|
|
19031
|
-
throw new Error("Empty `url` not allowed");
|
|
19032
|
-
}
|
|
19033
|
-
if (params) {
|
|
19034
|
-
const _a = params, restParams = __objRest$2(_a, ["paramList"]);
|
|
19035
|
-
url = template(url, restParams);
|
|
19036
|
-
}
|
|
19037
|
-
url = encodeURI(fixUrlStr(url));
|
|
19038
|
-
options = __spreadValues$q({ withCredentials: this.withCredentials }, options);
|
|
19039
|
-
const {
|
|
19040
|
-
cache,
|
|
19041
|
-
signal: externalSignal,
|
|
19042
|
-
method = "GET",
|
|
19043
|
-
headers,
|
|
19044
|
-
cacheName,
|
|
19045
|
-
cacheProps,
|
|
19046
|
-
responseType,
|
|
19047
|
-
withCredentials
|
|
19048
|
-
} = options;
|
|
19049
|
-
const internalAbortController = new AbortController();
|
|
19050
|
-
const internalSignal = internalAbortController.signal;
|
|
19051
|
-
if (externalSignal) {
|
|
19052
|
-
if (externalSignal.aborted) {
|
|
19053
|
-
throw new AbortError();
|
|
19054
|
-
}
|
|
19055
|
-
externalSignal.addEventListener("abort", () => {
|
|
19056
|
-
internalAbortController.abort();
|
|
19057
|
-
});
|
|
19058
|
-
}
|
|
19059
|
-
options.signal = internalSignal;
|
|
19060
|
-
const createPromise = () => __async$p(this, null, function* () {
|
|
19061
|
-
const id = REQUEST_ID++;
|
|
19062
|
-
this.activeRequests[id] = internalAbortController;
|
|
19063
|
-
try {
|
|
19064
|
-
return this._loadData(url, options);
|
|
19065
|
-
} finally {
|
|
19066
|
-
this._cleanActiveRequest(id);
|
|
19067
|
-
}
|
|
19068
|
-
});
|
|
19069
|
-
if (cache && method === "GET") {
|
|
19070
|
-
const cacheOptions = cacheProps ? cacheProps : __spreadProps$g(__spreadValues$q({}, objectRemoveEmpty({
|
|
19071
|
-
headers,
|
|
19072
|
-
withCredentials,
|
|
19073
|
-
responseType,
|
|
19074
|
-
baseUrl: this.options.baseUrl,
|
|
19075
|
-
userId: (_b = this.user) == null ? void 0 : _b.id
|
|
19076
|
-
})), {
|
|
19077
|
-
params
|
|
19078
|
-
});
|
|
19079
|
-
return this.cache.add(
|
|
19080
|
-
cacheName || url,
|
|
19081
|
-
createPromise,
|
|
19082
|
-
cacheOptions,
|
|
19083
|
-
false
|
|
19084
|
-
);
|
|
19085
|
-
}
|
|
19086
|
-
return createPromise();
|
|
19087
|
-
});
|
|
19088
|
-
}
|
|
19089
19640
|
// -------------------------------------------------------------------------
|
|
19090
19641
|
// Resource Methods
|
|
19091
19642
|
// -------------------------------------------------------------------------
|
|
@@ -19161,98 +19712,27 @@ var NgwLeaflet = (function () {
|
|
|
19161
19712
|
deleteResource(resource) {
|
|
19162
19713
|
return this.resources.delete(resource);
|
|
19163
19714
|
}
|
|
19164
|
-
/**
|
|
19165
|
-
* @internal
|
|
19166
|
-
*/
|
|
19167
|
-
_loadData(url, options) {
|
|
19168
|
-
options.responseType = options.responseType || "json";
|
|
19169
|
-
return new Promise((resolve, reject) => {
|
|
19170
|
-
var _a;
|
|
19171
|
-
if (this.user) {
|
|
19172
|
-
options = options || {};
|
|
19173
|
-
options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
|
|
19174
|
-
}
|
|
19175
|
-
if (this.requestTransform) {
|
|
19176
|
-
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
19177
|
-
url = transUrl;
|
|
19178
|
-
options = transOptions;
|
|
19179
|
-
}
|
|
19180
|
-
let runOnAbort = void 0;
|
|
19181
|
-
loadData(url, resolve, options, reject, (handler) => {
|
|
19182
|
-
runOnAbort = handler;
|
|
19183
|
-
});
|
|
19184
|
-
(_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
|
|
19185
|
-
if (runOnAbort !== void 0) {
|
|
19186
|
-
runOnAbort();
|
|
19187
|
-
}
|
|
19188
|
-
reject(new AbortError());
|
|
19189
|
-
});
|
|
19190
|
-
}).catch((httpError) => {
|
|
19191
|
-
if (httpError.name !== "AbortError") {
|
|
19192
|
-
{
|
|
19193
|
-
console.warn("DEV WARN", httpError);
|
|
19194
|
-
}
|
|
19195
|
-
const er = this._handleHttpError(httpError);
|
|
19196
|
-
if (er) {
|
|
19197
|
-
throw er;
|
|
19198
|
-
}
|
|
19199
|
-
}
|
|
19200
|
-
throw httpError;
|
|
19201
|
-
});
|
|
19202
|
-
}
|
|
19203
|
-
_login(credentials, options) {
|
|
19204
|
-
return __async$p(this, null, function* () {
|
|
19205
|
-
try {
|
|
19206
|
-
const data = yield this.getUserInfo(credentials, options);
|
|
19207
|
-
this.user = data;
|
|
19208
|
-
this.emitter.emit("login", data);
|
|
19209
|
-
return data;
|
|
19210
|
-
} catch (er) {
|
|
19211
|
-
this.emitter.emit("login:error", er);
|
|
19212
|
-
throw er;
|
|
19213
|
-
}
|
|
19214
|
-
});
|
|
19215
|
-
}
|
|
19216
|
-
_cleanActiveRequest(requestId) {
|
|
19217
|
-
delete this.activeRequests[requestId];
|
|
19218
|
-
}
|
|
19219
|
-
_handleHttpError(er) {
|
|
19220
|
-
if (er) {
|
|
19221
|
-
if (er instanceof NgwError) {
|
|
19222
|
-
if (er.exception === "nextgisweb.resource.exception.ResourceNotFound") {
|
|
19223
|
-
throw new ResourceNotFoundError(er);
|
|
19224
|
-
} else if (er.exception === "nextgisweb.core.exception.InsufficientPermissions") {
|
|
19225
|
-
throw new InsufficientPermissionsError(er);
|
|
19226
|
-
}
|
|
19227
|
-
}
|
|
19228
|
-
}
|
|
19229
|
-
return er;
|
|
19230
|
-
}
|
|
19231
19715
|
}
|
|
19232
|
-
__publicField$p(NgwConnector, "errors", {
|
|
19233
|
-
NgwError,
|
|
19234
|
-
ResourceNotFoundError
|
|
19235
|
-
});
|
|
19236
19716
|
|
|
19237
|
-
var __defProp$
|
|
19238
|
-
var __defProps$
|
|
19239
|
-
var __getOwnPropDescs$
|
|
19717
|
+
var __defProp$A = Object.defineProperty;
|
|
19718
|
+
var __defProps$g = Object.defineProperties;
|
|
19719
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
19240
19720
|
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
19241
19721
|
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
19242
19722
|
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
19243
|
-
var __defNormalProp$
|
|
19723
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19244
19724
|
var __spreadValues$p = (a, b) => {
|
|
19245
19725
|
for (var prop in b || (b = {}))
|
|
19246
19726
|
if (__hasOwnProp$q.call(b, prop))
|
|
19247
|
-
__defNormalProp$
|
|
19727
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
19248
19728
|
if (__getOwnPropSymbols$q)
|
|
19249
19729
|
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
19250
19730
|
if (__propIsEnum$q.call(b, prop))
|
|
19251
|
-
__defNormalProp$
|
|
19731
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
19252
19732
|
}
|
|
19253
19733
|
return a;
|
|
19254
19734
|
};
|
|
19255
|
-
var __spreadProps$
|
|
19735
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
19256
19736
|
var __async$o = (__this, __arguments, generator) => {
|
|
19257
19737
|
return new Promise((resolve, reject) => {
|
|
19258
19738
|
var fulfilled = (value) => {
|
|
@@ -19357,13 +19837,13 @@ var NgwLeaflet = (function () {
|
|
|
19357
19837
|
for (const f of filters_) {
|
|
19358
19838
|
if (isPropertyFilter(f)) {
|
|
19359
19839
|
_queries.push(
|
|
19360
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
19840
|
+
fetchNgwLayerItemsRequest(__spreadProps$g(__spreadValues$p({}, opt), {
|
|
19361
19841
|
paramList: [..._parentAllParams, ...paramList, createParam(f)]
|
|
19362
19842
|
}))
|
|
19363
19843
|
);
|
|
19364
19844
|
} else {
|
|
19365
19845
|
getQueries(
|
|
19366
|
-
__spreadProps$
|
|
19846
|
+
__spreadProps$g(__spreadValues$p({}, opt), {
|
|
19367
19847
|
filters: f
|
|
19368
19848
|
}),
|
|
19369
19849
|
_queries,
|
|
@@ -19384,7 +19864,7 @@ var NgwLeaflet = (function () {
|
|
|
19384
19864
|
if (propertiesFilterList.length) {
|
|
19385
19865
|
for (const x of propertiesFilterList) {
|
|
19386
19866
|
getQueries(
|
|
19387
|
-
__spreadProps$
|
|
19867
|
+
__spreadProps$g(__spreadValues$p({}, opt), {
|
|
19388
19868
|
filters: x
|
|
19389
19869
|
}),
|
|
19390
19870
|
_queries,
|
|
@@ -19393,7 +19873,7 @@ var NgwLeaflet = (function () {
|
|
|
19393
19873
|
}
|
|
19394
19874
|
} else {
|
|
19395
19875
|
_queries.push(
|
|
19396
|
-
fetchNgwLayerItemsRequest(__spreadProps$
|
|
19876
|
+
fetchNgwLayerItemsRequest(__spreadProps$g(__spreadValues$p({}, opt), {
|
|
19397
19877
|
paramList: [..._parentAllParams, ...paramList, ...filters2]
|
|
19398
19878
|
}))
|
|
19399
19879
|
);
|
|
@@ -19458,25 +19938,25 @@ var NgwLeaflet = (function () {
|
|
|
19458
19938
|
);
|
|
19459
19939
|
}
|
|
19460
19940
|
|
|
19461
|
-
var __defProp$
|
|
19462
|
-
var __defProps$
|
|
19463
|
-
var __getOwnPropDescs$
|
|
19941
|
+
var __defProp$z = Object.defineProperty;
|
|
19942
|
+
var __defProps$f = Object.defineProperties;
|
|
19943
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
19464
19944
|
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
19465
19945
|
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
19466
19946
|
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
19467
|
-
var __defNormalProp$
|
|
19947
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19468
19948
|
var __spreadValues$o = (a, b) => {
|
|
19469
19949
|
for (var prop in b || (b = {}))
|
|
19470
19950
|
if (__hasOwnProp$p.call(b, prop))
|
|
19471
|
-
__defNormalProp$
|
|
19951
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
19472
19952
|
if (__getOwnPropSymbols$p)
|
|
19473
19953
|
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
19474
19954
|
if (__propIsEnum$p.call(b, prop))
|
|
19475
|
-
__defNormalProp$
|
|
19955
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
19476
19956
|
}
|
|
19477
19957
|
return a;
|
|
19478
19958
|
};
|
|
19479
|
-
var __spreadProps$
|
|
19959
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
19480
19960
|
var __async$n = (__this, __arguments, generator) => {
|
|
19481
19961
|
return new Promise((resolve, reject) => {
|
|
19482
19962
|
var fulfilled = (value) => {
|
|
@@ -19514,45 +19994,45 @@ var NgwLeaflet = (function () {
|
|
|
19514
19994
|
if (resp.geom) {
|
|
19515
19995
|
return createGeoJsonFeature(resp);
|
|
19516
19996
|
} else {
|
|
19517
|
-
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$
|
|
19997
|
+
const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$f(__spreadValues$o({}, options), {
|
|
19518
19998
|
geom: true,
|
|
19519
19999
|
fields: null,
|
|
19520
20000
|
extensions: null
|
|
19521
20001
|
}));
|
|
19522
20002
|
const geom = onlyGeomItem.geom;
|
|
19523
|
-
return createGeoJsonFeature(__spreadProps$
|
|
20003
|
+
return createGeoJsonFeature(__spreadProps$f(__spreadValues$o({}, resp), { geom }));
|
|
19524
20004
|
}
|
|
19525
20005
|
});
|
|
19526
|
-
return __spreadProps$
|
|
20006
|
+
return __spreadProps$f(__spreadValues$o({}, resp), {
|
|
19527
20007
|
toGeojson
|
|
19528
20008
|
});
|
|
19529
20009
|
});
|
|
19530
20010
|
}
|
|
19531
20011
|
|
|
19532
|
-
var __defProp$
|
|
20012
|
+
var __defProp$y = Object.defineProperty;
|
|
19533
20013
|
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
19534
20014
|
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
19535
20015
|
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
19536
|
-
var __defNormalProp$
|
|
20016
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19537
20017
|
var __spreadValues$n = (a, b) => {
|
|
19538
20018
|
for (var prop in b || (b = {}))
|
|
19539
20019
|
if (__hasOwnProp$o.call(b, prop))
|
|
19540
|
-
__defNormalProp$
|
|
20020
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
19541
20021
|
if (__getOwnPropSymbols$o)
|
|
19542
20022
|
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
19543
20023
|
if (__propIsEnum$o.call(b, prop))
|
|
19544
|
-
__defNormalProp$
|
|
20024
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
19545
20025
|
}
|
|
19546
20026
|
return a;
|
|
19547
20027
|
};
|
|
19548
|
-
var __publicField$
|
|
20028
|
+
var __publicField$p = (obj, key, value) => __defNormalProp$y(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19549
20029
|
class BookmarkItem {
|
|
19550
20030
|
constructor(options) {
|
|
19551
20031
|
this.options = options;
|
|
19552
|
-
__publicField$
|
|
19553
|
-
__publicField$
|
|
19554
|
-
__publicField$
|
|
19555
|
-
__publicField$
|
|
20032
|
+
__publicField$p(this, "name");
|
|
20033
|
+
__publicField$p(this, "resourceId");
|
|
20034
|
+
__publicField$p(this, "item");
|
|
20035
|
+
__publicField$p(this, "_extent");
|
|
19556
20036
|
this.resourceId = options.resourceId;
|
|
19557
20037
|
const item = options.item;
|
|
19558
20038
|
this.item = item;
|
|
@@ -19698,14 +20178,14 @@ var NgwLeaflet = (function () {
|
|
|
19698
20178
|
return true;
|
|
19699
20179
|
}
|
|
19700
20180
|
|
|
19701
|
-
var __defProp$
|
|
19702
|
-
var __defNormalProp$
|
|
19703
|
-
var __publicField$
|
|
20181
|
+
var __defProp$x = Object.defineProperty;
|
|
20182
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20183
|
+
var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19704
20184
|
class TreeHelper {
|
|
19705
20185
|
constructor(item) {
|
|
19706
|
-
__publicField$
|
|
19707
|
-
__publicField$
|
|
19708
|
-
__publicField$
|
|
20186
|
+
__publicField$o(this, "item");
|
|
20187
|
+
__publicField$o(this, "_children", []);
|
|
20188
|
+
__publicField$o(this, "_parent");
|
|
19709
20189
|
this.item = item;
|
|
19710
20190
|
}
|
|
19711
20191
|
setParent(parent) {
|
|
@@ -19768,19 +20248,19 @@ var NgwLeaflet = (function () {
|
|
|
19768
20248
|
}
|
|
19769
20249
|
}
|
|
19770
20250
|
|
|
19771
|
-
var __defProp$
|
|
19772
|
-
var __defNormalProp$
|
|
19773
|
-
var __publicField$
|
|
20251
|
+
var __defProp$w = Object.defineProperty;
|
|
20252
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20253
|
+
var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19774
20254
|
class BaseProperty {
|
|
19775
20255
|
constructor(name, item, options) {
|
|
19776
|
-
__publicField$
|
|
19777
|
-
__publicField$
|
|
19778
|
-
__publicField$
|
|
19779
|
-
__publicField$
|
|
19780
|
-
__publicField$
|
|
19781
|
-
__publicField$
|
|
19782
|
-
__publicField$
|
|
19783
|
-
__publicField$
|
|
20256
|
+
__publicField$n(this, "options");
|
|
20257
|
+
__publicField$n(this, "emitter", new EventEmitter());
|
|
20258
|
+
__publicField$n(this, "name");
|
|
20259
|
+
__publicField$n(this, "item");
|
|
20260
|
+
__publicField$n(this, "_blocked", false);
|
|
20261
|
+
__publicField$n(this, "_container");
|
|
20262
|
+
__publicField$n(this, "_value");
|
|
20263
|
+
__publicField$n(this, "_removeEventsListener");
|
|
19784
20264
|
this.item = item;
|
|
19785
20265
|
this.options = Object.assign({}, options);
|
|
19786
20266
|
this.name = name;
|
|
@@ -19877,23 +20357,23 @@ var NgwLeaflet = (function () {
|
|
|
19877
20357
|
}
|
|
19878
20358
|
}
|
|
19879
20359
|
|
|
19880
|
-
var __defProp$
|
|
20360
|
+
var __defProp$v = Object.defineProperty;
|
|
19881
20361
|
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
19882
20362
|
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
19883
20363
|
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
19884
|
-
var __defNormalProp$
|
|
20364
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19885
20365
|
var __spreadValues$m = (a, b) => {
|
|
19886
20366
|
for (var prop in b || (b = {}))
|
|
19887
20367
|
if (__hasOwnProp$n.call(b, prop))
|
|
19888
|
-
__defNormalProp$
|
|
20368
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
19889
20369
|
if (__getOwnPropSymbols$n)
|
|
19890
20370
|
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
19891
20371
|
if (__propIsEnum$n.call(b, prop))
|
|
19892
|
-
__defNormalProp$
|
|
20372
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
19893
20373
|
}
|
|
19894
20374
|
return a;
|
|
19895
20375
|
};
|
|
19896
|
-
var __publicField$
|
|
20376
|
+
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, key + "" , value);
|
|
19897
20377
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
19898
20378
|
constructor(name, item, options) {
|
|
19899
20379
|
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
@@ -20001,7 +20481,7 @@ var NgwLeaflet = (function () {
|
|
|
20001
20481
|
}
|
|
20002
20482
|
}
|
|
20003
20483
|
};
|
|
20004
|
-
__publicField$
|
|
20484
|
+
__publicField$m(_CheckProperty, "options", {
|
|
20005
20485
|
hierarchy: true,
|
|
20006
20486
|
bubble: false,
|
|
20007
20487
|
propagation: false,
|
|
@@ -20010,31 +20490,31 @@ var NgwLeaflet = (function () {
|
|
|
20010
20490
|
});
|
|
20011
20491
|
let CheckProperty = _CheckProperty;
|
|
20012
20492
|
|
|
20013
|
-
var __defProp$
|
|
20493
|
+
var __defProp$u = Object.defineProperty;
|
|
20014
20494
|
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
20015
20495
|
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
20016
20496
|
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
20017
|
-
var __defNormalProp$
|
|
20497
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20018
20498
|
var __spreadValues$l = (a, b) => {
|
|
20019
20499
|
for (var prop in b || (b = {}))
|
|
20020
20500
|
if (__hasOwnProp$m.call(b, prop))
|
|
20021
|
-
__defNormalProp$
|
|
20501
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
20022
20502
|
if (__getOwnPropSymbols$m)
|
|
20023
20503
|
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
20024
20504
|
if (__propIsEnum$m.call(b, prop))
|
|
20025
|
-
__defNormalProp$
|
|
20505
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
20026
20506
|
}
|
|
20027
20507
|
return a;
|
|
20028
20508
|
};
|
|
20029
|
-
var __publicField$
|
|
20509
|
+
var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20030
20510
|
const BOOLEAN_TYPE = "boolean";
|
|
20031
20511
|
const STRING_TYPE = "string";
|
|
20032
20512
|
const _ItemProperties = class _ItemProperties {
|
|
20033
20513
|
constructor(item, propertiesList) {
|
|
20034
20514
|
this.item = item;
|
|
20035
|
-
__publicField$
|
|
20036
|
-
__publicField$
|
|
20037
|
-
__publicField$
|
|
20515
|
+
__publicField$l(this, "options", {});
|
|
20516
|
+
__publicField$l(this, "_properties", {});
|
|
20517
|
+
__publicField$l(this, "_propertiesList", []);
|
|
20038
20518
|
if (propertiesList) {
|
|
20039
20519
|
propertiesList.forEach(this._setPropertyHandler.bind(this));
|
|
20040
20520
|
}
|
|
@@ -20097,35 +20577,35 @@ var NgwLeaflet = (function () {
|
|
|
20097
20577
|
return Handler;
|
|
20098
20578
|
}
|
|
20099
20579
|
};
|
|
20100
|
-
__publicField$
|
|
20580
|
+
__publicField$l(_ItemProperties, "handlers", {
|
|
20101
20581
|
CheckProperty
|
|
20102
20582
|
});
|
|
20103
20583
|
let ItemProperties = _ItemProperties;
|
|
20104
20584
|
|
|
20105
|
-
var __defProp$
|
|
20585
|
+
var __defProp$t = Object.defineProperty;
|
|
20106
20586
|
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
20107
20587
|
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
20108
20588
|
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
20109
|
-
var __defNormalProp$
|
|
20589
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20110
20590
|
var __spreadValues$k = (a, b) => {
|
|
20111
20591
|
for (var prop in b || (b = {}))
|
|
20112
20592
|
if (__hasOwnProp$l.call(b, prop))
|
|
20113
|
-
__defNormalProp$
|
|
20593
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
20114
20594
|
if (__getOwnPropSymbols$l)
|
|
20115
20595
|
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
20116
20596
|
if (__propIsEnum$l.call(b, prop))
|
|
20117
|
-
__defNormalProp$
|
|
20597
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
20118
20598
|
}
|
|
20119
20599
|
return a;
|
|
20120
20600
|
};
|
|
20121
|
-
var __publicField$
|
|
20601
|
+
var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20122
20602
|
let ID$1 = 0;
|
|
20123
20603
|
class Item {
|
|
20124
20604
|
constructor(options) {
|
|
20125
|
-
__publicField$
|
|
20126
|
-
__publicField$
|
|
20127
|
-
__publicField$
|
|
20128
|
-
__publicField$
|
|
20605
|
+
__publicField$k(this, "options", {});
|
|
20606
|
+
__publicField$k(this, "properties");
|
|
20607
|
+
__publicField$k(this, "tree");
|
|
20608
|
+
__publicField$k(this, "id", ID$1);
|
|
20129
20609
|
ID$1 += 1;
|
|
20130
20610
|
this.options = __spreadValues$k({}, options);
|
|
20131
20611
|
this.tree = new TreeHelper(this);
|
|
@@ -20179,25 +20659,25 @@ var NgwLeaflet = (function () {
|
|
|
20179
20659
|
}
|
|
20180
20660
|
}
|
|
20181
20661
|
|
|
20182
|
-
var __defProp$
|
|
20183
|
-
var __defProps$
|
|
20184
|
-
var __getOwnPropDescs$
|
|
20662
|
+
var __defProp$s = Object.defineProperty;
|
|
20663
|
+
var __defProps$e = Object.defineProperties;
|
|
20664
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
20185
20665
|
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
20186
20666
|
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
20187
20667
|
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
20188
|
-
var __defNormalProp$
|
|
20668
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20189
20669
|
var __spreadValues$j = (a, b) => {
|
|
20190
20670
|
for (var prop in b || (b = {}))
|
|
20191
20671
|
if (__hasOwnProp$k.call(b, prop))
|
|
20192
|
-
__defNormalProp$
|
|
20672
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
20193
20673
|
if (__getOwnPropSymbols$k)
|
|
20194
20674
|
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
20195
20675
|
if (__propIsEnum$k.call(b, prop))
|
|
20196
|
-
__defNormalProp$
|
|
20676
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
20197
20677
|
}
|
|
20198
20678
|
return a;
|
|
20199
20679
|
};
|
|
20200
|
-
var __spreadProps$
|
|
20680
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
20201
20681
|
function getNgwWebmapExtent(webmap) {
|
|
20202
20682
|
const bottom = webmap["extent_bottom"];
|
|
20203
20683
|
const left = webmap["extent_left"];
|
|
@@ -20265,14 +20745,14 @@ var NgwLeaflet = (function () {
|
|
|
20265
20745
|
if (resource.cls && resource.cls.indexOf("style") !== -1) {
|
|
20266
20746
|
return connector.getResource(resource.parent.id, options).then((res) => {
|
|
20267
20747
|
if (res) {
|
|
20268
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
20748
|
+
return fetchNgwLayerExtent(__spreadProps$e(__spreadValues$j({}, options), {
|
|
20269
20749
|
resourceId: res.resource.id,
|
|
20270
20750
|
connector
|
|
20271
20751
|
}));
|
|
20272
20752
|
}
|
|
20273
20753
|
});
|
|
20274
20754
|
} else {
|
|
20275
|
-
return fetchNgwLayerExtent(__spreadProps$
|
|
20755
|
+
return fetchNgwLayerExtent(__spreadProps$e(__spreadValues$j({}, options), {
|
|
20276
20756
|
resourceId: resource.id,
|
|
20277
20757
|
connector
|
|
20278
20758
|
}));
|
|
@@ -20280,9 +20760,9 @@ var NgwLeaflet = (function () {
|
|
|
20280
20760
|
}
|
|
20281
20761
|
}
|
|
20282
20762
|
|
|
20283
|
-
var __defProp$
|
|
20284
|
-
var __defNormalProp$
|
|
20285
|
-
var __publicField$
|
|
20763
|
+
var __defProp$r = Object.defineProperty;
|
|
20764
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20765
|
+
var __publicField$j = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20286
20766
|
var __async$m = (__this, __arguments, generator) => {
|
|
20287
20767
|
return new Promise((resolve, reject) => {
|
|
20288
20768
|
var fulfilled = (value) => {
|
|
@@ -20305,9 +20785,9 @@ var NgwLeaflet = (function () {
|
|
|
20305
20785
|
};
|
|
20306
20786
|
class NgwResource {
|
|
20307
20787
|
constructor() {
|
|
20308
|
-
__publicField$
|
|
20309
|
-
__publicField$
|
|
20310
|
-
__publicField$
|
|
20788
|
+
__publicField$j(this, "item");
|
|
20789
|
+
__publicField$j(this, "connector");
|
|
20790
|
+
__publicField$j(this, "_extent");
|
|
20311
20791
|
}
|
|
20312
20792
|
/** @deprecated use {@link NgwResource.getBounds} instead */
|
|
20313
20793
|
getExtent() {
|
|
@@ -20426,23 +20906,23 @@ var NgwLeaflet = (function () {
|
|
|
20426
20906
|
};
|
|
20427
20907
|
}
|
|
20428
20908
|
|
|
20429
|
-
var __defProp$
|
|
20909
|
+
var __defProp$q = Object.defineProperty;
|
|
20430
20910
|
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
20431
20911
|
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
20432
20912
|
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
20433
|
-
var __defNormalProp$
|
|
20913
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20434
20914
|
var __spreadValues$i = (a, b) => {
|
|
20435
20915
|
for (var prop in b || (b = {}))
|
|
20436
20916
|
if (__hasOwnProp$j.call(b, prop))
|
|
20437
|
-
__defNormalProp$
|
|
20917
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
20438
20918
|
if (__getOwnPropSymbols$j)
|
|
20439
20919
|
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
20440
20920
|
if (__propIsEnum$j.call(b, prop))
|
|
20441
|
-
__defNormalProp$
|
|
20921
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
20442
20922
|
}
|
|
20443
20923
|
return a;
|
|
20444
20924
|
};
|
|
20445
|
-
var __objRest$
|
|
20925
|
+
var __objRest$2 = (source, exclude) => {
|
|
20446
20926
|
var target = {};
|
|
20447
20927
|
for (var prop in source)
|
|
20448
20928
|
if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -20454,7 +20934,7 @@ var NgwLeaflet = (function () {
|
|
|
20454
20934
|
}
|
|
20455
20935
|
return target;
|
|
20456
20936
|
};
|
|
20457
|
-
var __publicField$
|
|
20937
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20458
20938
|
var __async$k = (__this, __arguments, generator) => {
|
|
20459
20939
|
return new Promise((resolve, reject) => {
|
|
20460
20940
|
var fulfilled = (value) => {
|
|
@@ -20475,11 +20955,11 @@ var NgwLeaflet = (function () {
|
|
|
20475
20955
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
20476
20956
|
});
|
|
20477
20957
|
};
|
|
20478
|
-
const URL = "https://qms.nextgis.com";
|
|
20479
|
-
function createQmsAdapter(webMapOrOptions, url = URL, createOpt = {}) {
|
|
20958
|
+
const URL$1 = "https://qms.nextgis.com";
|
|
20959
|
+
function createQmsAdapter(webMapOrOptions, url = URL$1, createOpt = {}) {
|
|
20480
20960
|
let webMap;
|
|
20481
20961
|
if ("webMap" in webMapOrOptions) {
|
|
20482
|
-
const _a = webMapOrOptions, { webMap: webMap_, url: url_ } = _a, adapterOptions = __objRest$
|
|
20962
|
+
const _a = webMapOrOptions, { webMap: webMap_, url: url_ } = _a, adapterOptions = __objRest$2(_a, ["webMap", "url"]);
|
|
20483
20963
|
webMap = webMap_;
|
|
20484
20964
|
if (url_) {
|
|
20485
20965
|
url = url_;
|
|
@@ -20491,13 +20971,13 @@ var NgwLeaflet = (function () {
|
|
|
20491
20971
|
webMap = webMapOrOptions;
|
|
20492
20972
|
}
|
|
20493
20973
|
if (!url) {
|
|
20494
|
-
url = URL;
|
|
20974
|
+
url = URL$1;
|
|
20495
20975
|
}
|
|
20496
20976
|
class QmsAdapter {
|
|
20497
20977
|
constructor(map, options) {
|
|
20498
|
-
__publicField$
|
|
20499
|
-
__publicField$
|
|
20500
|
-
__publicField$
|
|
20978
|
+
__publicField$i(this, "qms");
|
|
20979
|
+
__publicField$i(this, "options");
|
|
20980
|
+
__publicField$i(this, "map");
|
|
20501
20981
|
this.map = map;
|
|
20502
20982
|
const opt = __spreadValues$i(__spreadValues$i({}, createOpt), options);
|
|
20503
20983
|
this.options = opt;
|
|
@@ -20551,29 +21031,29 @@ var NgwLeaflet = (function () {
|
|
|
20551
21031
|
return QmsAdapter;
|
|
20552
21032
|
}
|
|
20553
21033
|
|
|
20554
|
-
var __defProp$
|
|
21034
|
+
var __defProp$p = Object.defineProperty;
|
|
20555
21035
|
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
20556
21036
|
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
20557
21037
|
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
20558
|
-
var __defNormalProp$
|
|
21038
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20559
21039
|
var __spreadValues$h = (a, b) => {
|
|
20560
21040
|
for (var prop in b || (b = {}))
|
|
20561
21041
|
if (__hasOwnProp$i.call(b, prop))
|
|
20562
|
-
__defNormalProp$
|
|
21042
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
20563
21043
|
if (__getOwnPropSymbols$i)
|
|
20564
21044
|
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
20565
21045
|
if (__propIsEnum$i.call(b, prop))
|
|
20566
|
-
__defNormalProp$
|
|
21046
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
20567
21047
|
}
|
|
20568
21048
|
return a;
|
|
20569
21049
|
};
|
|
20570
|
-
var __publicField$
|
|
21050
|
+
var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20571
21051
|
class QmsKit {
|
|
20572
21052
|
constructor(options) {
|
|
20573
|
-
__publicField$
|
|
21053
|
+
__publicField$h(this, "options", {
|
|
20574
21054
|
url: "https://qms.nextgis.com"
|
|
20575
21055
|
});
|
|
20576
|
-
__publicField$
|
|
21056
|
+
__publicField$h(this, "url");
|
|
20577
21057
|
this.options = __spreadValues$h(__spreadValues$h({}, this.options), options);
|
|
20578
21058
|
this.url = this.options.url;
|
|
20579
21059
|
}
|
|
@@ -20589,31 +21069,31 @@ var NgwLeaflet = (function () {
|
|
|
20589
21069
|
return createQmsAdapter({ webMap, url: this.url });
|
|
20590
21070
|
}
|
|
20591
21071
|
}
|
|
20592
|
-
__publicField$
|
|
21072
|
+
__publicField$h(QmsKit, "utils", {
|
|
20593
21073
|
createQmsAdapter
|
|
20594
21074
|
});
|
|
20595
21075
|
|
|
20596
|
-
var __defProp$
|
|
20597
|
-
var __defProps$
|
|
20598
|
-
var __getOwnPropDescs$
|
|
21076
|
+
var __defProp$o = Object.defineProperty;
|
|
21077
|
+
var __defProps$d = Object.defineProperties;
|
|
21078
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
20599
21079
|
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
20600
21080
|
var __getProtoOf$2 = Object.getPrototypeOf;
|
|
20601
21081
|
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
20602
21082
|
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
|
20603
21083
|
var __reflectGet$2 = Reflect.get;
|
|
20604
|
-
var __defNormalProp$
|
|
21084
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20605
21085
|
var __spreadValues$g = (a, b) => {
|
|
20606
21086
|
for (var prop in b || (b = {}))
|
|
20607
21087
|
if (__hasOwnProp$h.call(b, prop))
|
|
20608
|
-
__defNormalProp$
|
|
21088
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
20609
21089
|
if (__getOwnPropSymbols$h)
|
|
20610
21090
|
for (var prop of __getOwnPropSymbols$h(b)) {
|
|
20611
21091
|
if (__propIsEnum$h.call(b, prop))
|
|
20612
|
-
__defNormalProp$
|
|
21092
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
20613
21093
|
}
|
|
20614
21094
|
return a;
|
|
20615
21095
|
};
|
|
20616
|
-
var __spreadProps$
|
|
21096
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
20617
21097
|
var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
|
|
20618
21098
|
var __async$j = (__this, __arguments, generator) => {
|
|
20619
21099
|
return new Promise((resolve, reject) => {
|
|
@@ -20658,7 +21138,7 @@ var NgwLeaflet = (function () {
|
|
|
20658
21138
|
class BasemapTileAdapter extends TileAdapter {
|
|
20659
21139
|
addLayer(opt) {
|
|
20660
21140
|
return __async$j(this, null, function* () {
|
|
20661
|
-
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$
|
|
21141
|
+
return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$d(__spreadValues$g({}, opt), { url }));
|
|
20662
21142
|
});
|
|
20663
21143
|
}
|
|
20664
21144
|
}
|
|
@@ -20737,25 +21217,25 @@ var NgwLeaflet = (function () {
|
|
|
20737
21217
|
return fields;
|
|
20738
21218
|
}
|
|
20739
21219
|
|
|
20740
|
-
var __defProp$
|
|
20741
|
-
var __defProps$
|
|
20742
|
-
var __getOwnPropDescs$
|
|
21220
|
+
var __defProp$n = Object.defineProperty;
|
|
21221
|
+
var __defProps$c = Object.defineProperties;
|
|
21222
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
20743
21223
|
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
20744
21224
|
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
20745
21225
|
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
20746
|
-
var __defNormalProp$
|
|
21226
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20747
21227
|
var __spreadValues$f = (a, b) => {
|
|
20748
21228
|
for (var prop in b || (b = {}))
|
|
20749
21229
|
if (__hasOwnProp$g.call(b, prop))
|
|
20750
|
-
__defNormalProp$
|
|
21230
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
20751
21231
|
if (__getOwnPropSymbols$g)
|
|
20752
21232
|
for (var prop of __getOwnPropSymbols$g(b)) {
|
|
20753
21233
|
if (__propIsEnum$g.call(b, prop))
|
|
20754
|
-
__defNormalProp$
|
|
21234
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
20755
21235
|
}
|
|
20756
21236
|
return a;
|
|
20757
21237
|
};
|
|
20758
|
-
var __spreadProps$
|
|
21238
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
20759
21239
|
var __async$i = (__this, __arguments, generator) => {
|
|
20760
21240
|
return new Promise((resolve, reject) => {
|
|
20761
21241
|
var fulfilled = (value) => {
|
|
@@ -20781,13 +21261,13 @@ var NgwLeaflet = (function () {
|
|
|
20781
21261
|
var _a;
|
|
20782
21262
|
const filters = options.filters;
|
|
20783
21263
|
if (filters) {
|
|
20784
|
-
let data = yield createFeatureFieldFilterQueries(__spreadProps$
|
|
21264
|
+
let data = yield createFeatureFieldFilterQueries(__spreadProps$c(__spreadValues$f({}, options), {
|
|
20785
21265
|
filters
|
|
20786
21266
|
}));
|
|
20787
21267
|
const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
|
|
20788
21268
|
if (clientFilterValidate) {
|
|
20789
21269
|
data = data.filter((y) => {
|
|
20790
|
-
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$
|
|
21270
|
+
const fields = prepareNgwFieldsToPropertiesFilter(__spreadProps$c(__spreadValues$f({}, y.fields), {
|
|
20791
21271
|
id: y.id
|
|
20792
21272
|
}));
|
|
20793
21273
|
const result = propertiesFilter(fields, filters);
|
|
@@ -20875,28 +21355,28 @@ var NgwLeaflet = (function () {
|
|
|
20875
21355
|
return filterOptions;
|
|
20876
21356
|
}
|
|
20877
21357
|
|
|
20878
|
-
var __defProp$
|
|
20879
|
-
var __defProps$
|
|
20880
|
-
var __getOwnPropDescs$
|
|
21358
|
+
var __defProp$m = Object.defineProperty;
|
|
21359
|
+
var __defProps$b = Object.defineProperties;
|
|
21360
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
20881
21361
|
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
20882
21362
|
var __getProtoOf$1 = Object.getPrototypeOf;
|
|
20883
21363
|
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
20884
21364
|
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
20885
21365
|
var __reflectGet$1 = Reflect.get;
|
|
20886
|
-
var __defNormalProp$
|
|
21366
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20887
21367
|
var __spreadValues$e = (a, b) => {
|
|
20888
21368
|
for (var prop in b || (b = {}))
|
|
20889
21369
|
if (__hasOwnProp$f.call(b, prop))
|
|
20890
|
-
__defNormalProp$
|
|
21370
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
20891
21371
|
if (__getOwnPropSymbols$f)
|
|
20892
21372
|
for (var prop of __getOwnPropSymbols$f(b)) {
|
|
20893
21373
|
if (__propIsEnum$f.call(b, prop))
|
|
20894
|
-
__defNormalProp$
|
|
21374
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
20895
21375
|
}
|
|
20896
21376
|
return a;
|
|
20897
21377
|
};
|
|
20898
|
-
var __spreadProps$
|
|
20899
|
-
var __publicField$
|
|
21378
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
21379
|
+
var __publicField$g = (obj, key, value) => __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20900
21380
|
var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
|
|
20901
21381
|
var __async$g = (__this, __arguments, generator) => {
|
|
20902
21382
|
return new Promise((resolve, reject) => {
|
|
@@ -20969,11 +21449,11 @@ var NgwLeaflet = (function () {
|
|
|
20969
21449
|
class NgwGeoJsonAdapter extends GeoJsonAdapter {
|
|
20970
21450
|
constructor() {
|
|
20971
21451
|
super(...arguments);
|
|
20972
|
-
__publicField$
|
|
20973
|
-
__publicField$
|
|
20974
|
-
__publicField$
|
|
20975
|
-
__publicField$
|
|
20976
|
-
__publicField$
|
|
21452
|
+
__publicField$g(this, "emitter", new EventEmitter());
|
|
21453
|
+
__publicField$g(this, "__onMapMove");
|
|
21454
|
+
__publicField$g(this, "__onMapMoveStart");
|
|
21455
|
+
__publicField$g(this, "__enableMapMoveListener");
|
|
21456
|
+
__publicField$g(this, "__disableMapMoveListener");
|
|
20977
21457
|
}
|
|
20978
21458
|
addLayer(opt) {
|
|
20979
21459
|
return __async$g(this, null, function* () {
|
|
@@ -21046,10 +21526,10 @@ var NgwLeaflet = (function () {
|
|
|
21046
21526
|
getCount() {
|
|
21047
21527
|
return fetchNgwLayerCount({ connector, resourceId, cache: true });
|
|
21048
21528
|
}
|
|
21049
|
-
updateLayer(
|
|
21529
|
+
updateLayer(opt) {
|
|
21050
21530
|
return __async$g(this, null, function* () {
|
|
21051
21531
|
var _a2;
|
|
21052
|
-
filterArgs =
|
|
21532
|
+
const filterArgs = opt || _lastFilterArgs || {};
|
|
21053
21533
|
if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
|
|
21054
21534
|
yield webMap.onLoad("create");
|
|
21055
21535
|
filterArgs.options = filterArgs.options || {};
|
|
@@ -21074,7 +21554,7 @@ var NgwLeaflet = (function () {
|
|
|
21074
21554
|
try {
|
|
21075
21555
|
this.emitter.emit("preupdate", filterArgs);
|
|
21076
21556
|
webMap._emitLayerEvent("layer:preupdate", options.id || "", filterArgs);
|
|
21077
|
-
const data = yield getData(filterArgs.filters, __spreadProps$
|
|
21557
|
+
const data = yield getData(filterArgs.filters, __spreadProps$b(__spreadValues$e({}, filterArgs.options), {
|
|
21078
21558
|
srs: this.options.srs
|
|
21079
21559
|
}));
|
|
21080
21560
|
let newData = data;
|
|
@@ -21127,7 +21607,7 @@ var NgwLeaflet = (function () {
|
|
|
21127
21607
|
if (this.clearLayer) {
|
|
21128
21608
|
this.clearLayer();
|
|
21129
21609
|
}
|
|
21130
|
-
const data = yield getData(filters, __spreadProps$
|
|
21610
|
+
const data = yield getData(filters, __spreadProps$b(__spreadValues$e({}, opt), {
|
|
21131
21611
|
srs: this.options.srs
|
|
21132
21612
|
}));
|
|
21133
21613
|
this.setData(data);
|
|
@@ -21316,26 +21796,26 @@ var NgwLeaflet = (function () {
|
|
|
21316
21796
|
}
|
|
21317
21797
|
}
|
|
21318
21798
|
|
|
21319
|
-
var __defProp$
|
|
21320
|
-
var __defProps$
|
|
21321
|
-
var __getOwnPropDescs$
|
|
21799
|
+
var __defProp$l = Object.defineProperty;
|
|
21800
|
+
var __defProps$a = Object.defineProperties;
|
|
21801
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
21322
21802
|
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
21323
21803
|
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
21324
21804
|
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
21325
|
-
var __defNormalProp$
|
|
21805
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21326
21806
|
var __spreadValues$d = (a, b) => {
|
|
21327
21807
|
for (var prop in b || (b = {}))
|
|
21328
21808
|
if (__hasOwnProp$e.call(b, prop))
|
|
21329
|
-
__defNormalProp$
|
|
21809
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
21330
21810
|
if (__getOwnPropSymbols$e)
|
|
21331
21811
|
for (var prop of __getOwnPropSymbols$e(b)) {
|
|
21332
21812
|
if (__propIsEnum$e.call(b, prop))
|
|
21333
|
-
__defNormalProp$
|
|
21813
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
21334
21814
|
}
|
|
21335
21815
|
return a;
|
|
21336
21816
|
};
|
|
21337
|
-
var __spreadProps$
|
|
21338
|
-
var __publicField$
|
|
21817
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
21818
|
+
var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21339
21819
|
var __async$e = (__this, __arguments, generator) => {
|
|
21340
21820
|
return new Promise((resolve, reject) => {
|
|
21341
21821
|
var fulfilled = (value) => {
|
|
@@ -21356,11 +21836,47 @@ var NgwLeaflet = (function () {
|
|
|
21356
21836
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
21357
21837
|
});
|
|
21358
21838
|
};
|
|
21839
|
+
class Legend {
|
|
21840
|
+
constructor({
|
|
21841
|
+
layerId,
|
|
21842
|
+
legend,
|
|
21843
|
+
onSymbolRenderChange
|
|
21844
|
+
}) {
|
|
21845
|
+
__publicField$f(this, "layerId");
|
|
21846
|
+
__publicField$f(this, "legend");
|
|
21847
|
+
__publicField$f(this, "onSymbolRenderChange");
|
|
21848
|
+
this.layerId = layerId;
|
|
21849
|
+
this.legend = this.createLegend(legend);
|
|
21850
|
+
this.onSymbolRenderChange = onSymbolRenderChange;
|
|
21851
|
+
}
|
|
21852
|
+
createLegend(items) {
|
|
21853
|
+
return items.map((params) => __spreadProps$a(__spreadValues$d({}, params), {
|
|
21854
|
+
/** @deprecated use display_name instead */
|
|
21855
|
+
name: params.display_name,
|
|
21856
|
+
/** @deprecated use icon instead */
|
|
21857
|
+
symbol: params.icon
|
|
21858
|
+
}));
|
|
21859
|
+
}
|
|
21860
|
+
setSymbolRender(symbolIndex, status) {
|
|
21861
|
+
const legendItem = this.legend.find((l) => l.index === symbolIndex);
|
|
21862
|
+
if (legendItem) {
|
|
21863
|
+
const render = legendItem.render;
|
|
21864
|
+
if (render !== status) {
|
|
21865
|
+
legendItem.render = status;
|
|
21866
|
+
if (this.onSymbolRenderChange) {
|
|
21867
|
+
this.onSymbolRenderChange(
|
|
21868
|
+
this.legend.filter((l) => l.render).map((l) => l.index)
|
|
21869
|
+
);
|
|
21870
|
+
}
|
|
21871
|
+
}
|
|
21872
|
+
}
|
|
21873
|
+
}
|
|
21874
|
+
}
|
|
21359
21875
|
function createRasterAdapter(_0) {
|
|
21360
21876
|
return __async$e(this, arguments, function* ({
|
|
21361
21877
|
layerOptions,
|
|
21362
|
-
webMap,
|
|
21363
21878
|
connector,
|
|
21879
|
+
webMap,
|
|
21364
21880
|
item
|
|
21365
21881
|
}) {
|
|
21366
21882
|
const resourceCls = item.resource.cls;
|
|
@@ -21389,16 +21905,17 @@ var NgwLeaflet = (function () {
|
|
|
21389
21905
|
constructor(map, _options) {
|
|
21390
21906
|
super(map, _options);
|
|
21391
21907
|
this.map = map;
|
|
21392
|
-
|
|
21393
|
-
__publicField$
|
|
21394
|
-
__publicField$
|
|
21908
|
+
__publicField$f(this, "item", item);
|
|
21909
|
+
__publicField$f(this, "resourceId", resourceId);
|
|
21910
|
+
__publicField$f(this, "_blocked", false);
|
|
21911
|
+
__publicField$f(this, "_layerVisibility");
|
|
21395
21912
|
const opt = ngwApiToAdapterOptions({
|
|
21396
21913
|
options: layerOptions,
|
|
21397
21914
|
webMap,
|
|
21398
21915
|
baseUrl: connector.options.baseUrl || ""
|
|
21399
21916
|
});
|
|
21400
21917
|
if (opt) {
|
|
21401
|
-
const layerAdapterOptions = __spreadProps$
|
|
21918
|
+
const layerAdapterOptions = __spreadProps$a(__spreadValues$d(__spreadValues$d({}, opt), layerOptions.adapterOptions), {
|
|
21402
21919
|
params: { resource: resourceId },
|
|
21403
21920
|
layers: opt.layers || String(resourceId),
|
|
21404
21921
|
resourceId
|
|
@@ -21412,25 +21929,19 @@ var NgwLeaflet = (function () {
|
|
|
21412
21929
|
addLayer(addOptions) {
|
|
21413
21930
|
return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
|
|
21414
21931
|
}
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
}, options));
|
|
21421
|
-
const id = this.options.id;
|
|
21422
|
-
if (id !== void 0) {
|
|
21423
|
-
const legend = {
|
|
21424
|
-
layerId: id,
|
|
21425
|
-
legend: ngwLegend.map(({ display_name, icon }) => ({
|
|
21426
|
-
name: display_name,
|
|
21427
|
-
symbol: icon
|
|
21428
|
-
}))
|
|
21429
|
-
};
|
|
21430
|
-
return [legend];
|
|
21932
|
+
showLayer() {
|
|
21933
|
+
this._layerVisibility = true;
|
|
21934
|
+
if (this.layer) {
|
|
21935
|
+
if (!this._blocked) {
|
|
21936
|
+
webMap.mapAdapter.showLayer(this.layer);
|
|
21431
21937
|
}
|
|
21432
|
-
|
|
21433
|
-
|
|
21938
|
+
}
|
|
21939
|
+
}
|
|
21940
|
+
hideLayer() {
|
|
21941
|
+
this._layerVisibility = false;
|
|
21942
|
+
if (this.layer) {
|
|
21943
|
+
webMap.mapAdapter.hideLayer(this.layer);
|
|
21944
|
+
}
|
|
21434
21945
|
}
|
|
21435
21946
|
getIdentificationIds() {
|
|
21436
21947
|
return __async$e(this, null, function* () {
|
|
@@ -21446,8 +21957,69 @@ var NgwLeaflet = (function () {
|
|
|
21446
21957
|
return [];
|
|
21447
21958
|
});
|
|
21448
21959
|
}
|
|
21449
|
-
|
|
21450
|
-
|
|
21960
|
+
getLegend(options) {
|
|
21961
|
+
return __async$e(this, null, function* () {
|
|
21962
|
+
const id = this.options.id;
|
|
21963
|
+
if (id !== void 0) {
|
|
21964
|
+
const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
|
|
21965
|
+
params: { id: resourceId },
|
|
21966
|
+
cache: true
|
|
21967
|
+
}, options));
|
|
21968
|
+
const legend = new Legend({
|
|
21969
|
+
layerId: id,
|
|
21970
|
+
legend: ngwLegend,
|
|
21971
|
+
onSymbolRenderChange: this._setLegendSymbol.bind(this)
|
|
21972
|
+
});
|
|
21973
|
+
return [legend];
|
|
21974
|
+
}
|
|
21975
|
+
return [];
|
|
21976
|
+
});
|
|
21977
|
+
}
|
|
21978
|
+
_hideLayer() {
|
|
21979
|
+
if (this.options.id) {
|
|
21980
|
+
webMap.mapAdapter.hideLayer(this.layer);
|
|
21981
|
+
}
|
|
21982
|
+
}
|
|
21983
|
+
_showLayer() {
|
|
21984
|
+
if (this.options.id) {
|
|
21985
|
+
if (this._layerVisibility) {
|
|
21986
|
+
webMap.showLayer(this.options.id, { silent: true });
|
|
21987
|
+
}
|
|
21988
|
+
}
|
|
21989
|
+
}
|
|
21990
|
+
_setLegendSymbol(renderIndexes) {
|
|
21991
|
+
const intervals = this._consolidateIntervals(renderIndexes);
|
|
21992
|
+
if (!intervals.length) {
|
|
21993
|
+
this._hideLayer();
|
|
21994
|
+
this._blocked = true;
|
|
21995
|
+
} else {
|
|
21996
|
+
this._blocked = false;
|
|
21997
|
+
this._showLayer();
|
|
21998
|
+
}
|
|
21999
|
+
if (this.updateLayer) {
|
|
22000
|
+
this.updateLayer({
|
|
22001
|
+
params: {
|
|
22002
|
+
[`symbols[${resourceId}]`]: intervals.join(",") || void 0
|
|
22003
|
+
}
|
|
22004
|
+
});
|
|
22005
|
+
}
|
|
22006
|
+
}
|
|
22007
|
+
_consolidateIntervals(symbols) {
|
|
22008
|
+
const sortedSymbols = symbols.slice().sort((a, b) => a - b);
|
|
22009
|
+
const intervals = [];
|
|
22010
|
+
let start = sortedSymbols[0];
|
|
22011
|
+
let end = start;
|
|
22012
|
+
for (let i = 1; i <= sortedSymbols.length; i++) {
|
|
22013
|
+
if (sortedSymbols[i] === end + 1) {
|
|
22014
|
+
end = sortedSymbols[i];
|
|
22015
|
+
} else {
|
|
22016
|
+
intervals.push(start === end ? `${start}` : `${start}-${end}`);
|
|
22017
|
+
start = sortedSymbols[i];
|
|
22018
|
+
end = start;
|
|
22019
|
+
}
|
|
22020
|
+
}
|
|
22021
|
+
return intervals;
|
|
22022
|
+
}
|
|
21451
22023
|
};
|
|
21452
22024
|
} else {
|
|
21453
22025
|
throw new Error(adapter + " not supported yet. Only TILE");
|
|
@@ -21455,25 +22027,25 @@ var NgwLeaflet = (function () {
|
|
|
21455
22027
|
});
|
|
21456
22028
|
}
|
|
21457
22029
|
|
|
21458
|
-
var __defProp$
|
|
21459
|
-
var __defProps$
|
|
21460
|
-
var __getOwnPropDescs$
|
|
22030
|
+
var __defProp$k = Object.defineProperty;
|
|
22031
|
+
var __defProps$9 = Object.defineProperties;
|
|
22032
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
21461
22033
|
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
21462
22034
|
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
21463
22035
|
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
21464
|
-
var __defNormalProp$
|
|
22036
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21465
22037
|
var __spreadValues$c = (a, b) => {
|
|
21466
22038
|
for (var prop in b || (b = {}))
|
|
21467
22039
|
if (__hasOwnProp$d.call(b, prop))
|
|
21468
|
-
__defNormalProp$
|
|
22040
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
21469
22041
|
if (__getOwnPropSymbols$d)
|
|
21470
22042
|
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
21471
22043
|
if (__propIsEnum$d.call(b, prop))
|
|
21472
|
-
__defNormalProp$
|
|
22044
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
21473
22045
|
}
|
|
21474
22046
|
return a;
|
|
21475
22047
|
};
|
|
21476
|
-
var __spreadProps$
|
|
22048
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
21477
22049
|
var __async$d = (__this, __arguments, generator) => {
|
|
21478
22050
|
return new Promise((resolve, reject) => {
|
|
21479
22051
|
var fulfilled = (value) => {
|
|
@@ -21521,7 +22093,7 @@ var NgwLeaflet = (function () {
|
|
|
21521
22093
|
const firstStyle = childrenStyles && childrenStyles[0];
|
|
21522
22094
|
if (firstStyle) {
|
|
21523
22095
|
return createAsyncAdapter(
|
|
21524
|
-
__spreadProps$
|
|
22096
|
+
__spreadProps$9(__spreadValues$c({}, layerOptions), { resource: firstStyle.resource.id }),
|
|
21525
22097
|
webMap,
|
|
21526
22098
|
connector
|
|
21527
22099
|
);
|
|
@@ -21544,7 +22116,7 @@ var NgwLeaflet = (function () {
|
|
|
21544
22116
|
}
|
|
21545
22117
|
if (item) {
|
|
21546
22118
|
const cls = item.resource.cls;
|
|
21547
|
-
const layerOptions = __spreadProps$
|
|
22119
|
+
const layerOptions = __spreadProps$9(__spreadValues$c({}, options), {
|
|
21548
22120
|
resource: resourceId
|
|
21549
22121
|
});
|
|
21550
22122
|
const adapterOptions = {
|
|
@@ -21581,10 +22153,10 @@ var NgwLeaflet = (function () {
|
|
|
21581
22153
|
item.resource.parent.id
|
|
21582
22154
|
);
|
|
21583
22155
|
if (parentItem) {
|
|
21584
|
-
const parentOptions = __spreadProps$
|
|
22156
|
+
const parentOptions = __spreadProps$9(__spreadValues$c({}, options), {
|
|
21585
22157
|
resource: item.resource.parent.id
|
|
21586
22158
|
});
|
|
21587
|
-
adapter = createGeoJsonAdapter(__spreadProps$
|
|
22159
|
+
adapter = createGeoJsonAdapter(__spreadProps$9(__spreadValues$c({}, adapterOptions), {
|
|
21588
22160
|
item: parentItem,
|
|
21589
22161
|
layerOptions: parentOptions
|
|
21590
22162
|
}));
|
|
@@ -21628,31 +22200,46 @@ var NgwLeaflet = (function () {
|
|
|
21628
22200
|
});
|
|
21629
22201
|
}
|
|
21630
22202
|
|
|
21631
|
-
var __defProp$
|
|
22203
|
+
var __defProp$j = Object.defineProperty;
|
|
22204
|
+
var __defProps$8 = Object.defineProperties;
|
|
22205
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
21632
22206
|
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
21633
22207
|
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
21634
22208
|
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
21635
|
-
var __defNormalProp$
|
|
22209
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21636
22210
|
var __spreadValues$b = (a, b) => {
|
|
21637
22211
|
for (var prop in b || (b = {}))
|
|
21638
22212
|
if (__hasOwnProp$c.call(b, prop))
|
|
21639
|
-
__defNormalProp$
|
|
22213
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
21640
22214
|
if (__getOwnPropSymbols$c)
|
|
21641
22215
|
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
21642
22216
|
if (__propIsEnum$c.call(b, prop))
|
|
21643
|
-
__defNormalProp$
|
|
22217
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
21644
22218
|
}
|
|
21645
22219
|
return a;
|
|
21646
22220
|
};
|
|
22221
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
22222
|
+
var __objRest$1 = (source, exclude) => {
|
|
22223
|
+
var target = {};
|
|
22224
|
+
for (var prop in source)
|
|
22225
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
22226
|
+
target[prop] = source[prop];
|
|
22227
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
22228
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
22229
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
22230
|
+
target[prop] = source[prop];
|
|
22231
|
+
}
|
|
22232
|
+
return target;
|
|
22233
|
+
};
|
|
21647
22234
|
function updateImageParams(params, resourceId) {
|
|
21648
|
-
const { bbox, width, height, nd } =
|
|
21649
|
-
return {
|
|
22235
|
+
const _a = params, { bbox, width, height, nd } = _a, rest = __objRest$1(_a, ["bbox", "width", "height", "nd"]);
|
|
22236
|
+
return __spreadProps$8(__spreadValues$b({}, rest), {
|
|
21650
22237
|
resource: Array.isArray(resourceId) ? resourceId.join(",") : resourceId,
|
|
21651
22238
|
extent: bbox,
|
|
21652
22239
|
size: width + "," + height,
|
|
21653
22240
|
timestamp: Date.now(),
|
|
21654
22241
|
nd: nd != null ? nd : 200
|
|
21655
|
-
};
|
|
22242
|
+
});
|
|
21656
22243
|
}
|
|
21657
22244
|
const vectorLayerGeomToPaintTypeAlias = {
|
|
21658
22245
|
POINT: "point",
|
|
@@ -21712,26 +22299,26 @@ var NgwLeaflet = (function () {
|
|
|
21712
22299
|
return zoom;
|
|
21713
22300
|
}
|
|
21714
22301
|
|
|
21715
|
-
var __defProp$
|
|
22302
|
+
var __defProp$i = Object.defineProperty;
|
|
21716
22303
|
var __defProps$7 = Object.defineProperties;
|
|
21717
22304
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
21718
22305
|
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
21719
22306
|
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
21720
22307
|
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
21721
|
-
var __defNormalProp$
|
|
22308
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21722
22309
|
var __spreadValues$a = (a, b) => {
|
|
21723
22310
|
for (var prop in b || (b = {}))
|
|
21724
22311
|
if (__hasOwnProp$b.call(b, prop))
|
|
21725
|
-
__defNormalProp$
|
|
22312
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
21726
22313
|
if (__getOwnPropSymbols$b)
|
|
21727
22314
|
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
21728
22315
|
if (__propIsEnum$b.call(b, prop))
|
|
21729
|
-
__defNormalProp$
|
|
22316
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
21730
22317
|
}
|
|
21731
22318
|
return a;
|
|
21732
22319
|
};
|
|
21733
22320
|
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
21734
|
-
var __publicField$
|
|
22321
|
+
var __publicField$e = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21735
22322
|
var __async$c = (__this, __arguments, generator) => {
|
|
21736
22323
|
return new Promise((resolve, reject) => {
|
|
21737
22324
|
var fulfilled = (value) => {
|
|
@@ -21756,11 +22343,11 @@ var NgwLeaflet = (function () {
|
|
|
21756
22343
|
constructor(webMap, item, options, connector, parent, noInit) {
|
|
21757
22344
|
super(__spreadValues$a(__spreadValues$a({}, _NgwWebmapItem.options), options));
|
|
21758
22345
|
this.webMap = webMap;
|
|
21759
|
-
__publicField$
|
|
21760
|
-
__publicField$
|
|
21761
|
-
__publicField$
|
|
21762
|
-
__publicField$
|
|
21763
|
-
__publicField$
|
|
22346
|
+
__publicField$e(this, "item");
|
|
22347
|
+
__publicField$e(this, "connector");
|
|
22348
|
+
__publicField$e(this, "layer");
|
|
22349
|
+
__publicField$e(this, "emitter", new EventEmitter());
|
|
22350
|
+
__publicField$e(this, "_rootDescendantsCount", 0);
|
|
21764
22351
|
if (connector) {
|
|
21765
22352
|
this.connector = connector;
|
|
21766
22353
|
}
|
|
@@ -21822,10 +22409,12 @@ var NgwLeaflet = (function () {
|
|
|
21822
22409
|
}, options));
|
|
21823
22410
|
const legend = {
|
|
21824
22411
|
layerId: id,
|
|
21825
|
-
legend: ngwLegend.map((
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
22412
|
+
legend: ngwLegend.map((legend2) => __spreadValues$a({
|
|
22413
|
+
/** @deprecated use display_name instead */
|
|
22414
|
+
name: legend2.display_name,
|
|
22415
|
+
/** @deprecated use icon instead */
|
|
22416
|
+
symbol: legend2.icon
|
|
22417
|
+
}, legend2))
|
|
21829
22418
|
};
|
|
21830
22419
|
return [legend];
|
|
21831
22420
|
}
|
|
@@ -21948,8 +22537,8 @@ var NgwLeaflet = (function () {
|
|
|
21948
22537
|
return totalValue;
|
|
21949
22538
|
}
|
|
21950
22539
|
};
|
|
21951
|
-
__publicField$
|
|
21952
|
-
__publicField$
|
|
22540
|
+
__publicField$e(_NgwWebmapItem, "GetAdapterFromLayerType", {});
|
|
22541
|
+
__publicField$e(_NgwWebmapItem, "options", {
|
|
21953
22542
|
properties: [
|
|
21954
22543
|
{
|
|
21955
22544
|
type: "boolean",
|
|
@@ -21989,23 +22578,23 @@ var NgwLeaflet = (function () {
|
|
|
21989
22578
|
});
|
|
21990
22579
|
let NgwWebmapItem = _NgwWebmapItem;
|
|
21991
22580
|
|
|
21992
|
-
var __defProp$
|
|
22581
|
+
var __defProp$h = Object.defineProperty;
|
|
21993
22582
|
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
21994
22583
|
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
21995
22584
|
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
21996
|
-
var __defNormalProp$
|
|
22585
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21997
22586
|
var __spreadValues$9 = (a, b) => {
|
|
21998
22587
|
for (var prop in b || (b = {}))
|
|
21999
22588
|
if (__hasOwnProp$a.call(b, prop))
|
|
22000
|
-
__defNormalProp$
|
|
22589
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
22001
22590
|
if (__getOwnPropSymbols$a)
|
|
22002
22591
|
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
22003
22592
|
if (__propIsEnum$a.call(b, prop))
|
|
22004
|
-
__defNormalProp$
|
|
22593
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
22005
22594
|
}
|
|
22006
22595
|
return a;
|
|
22007
22596
|
};
|
|
22008
|
-
var __publicField$
|
|
22597
|
+
var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22009
22598
|
var __async$b = (__this, __arguments, generator) => {
|
|
22010
22599
|
return new Promise((resolve, reject) => {
|
|
22011
22600
|
var fulfilled = (value) => {
|
|
@@ -22035,10 +22624,10 @@ var NgwLeaflet = (function () {
|
|
|
22035
22624
|
}) {
|
|
22036
22625
|
class OnFirstShowAdapter {
|
|
22037
22626
|
constructor() {
|
|
22038
|
-
__publicField$
|
|
22039
|
-
__publicField$
|
|
22040
|
-
__publicField$
|
|
22041
|
-
__publicField$
|
|
22627
|
+
__publicField$d(this, "options", {});
|
|
22628
|
+
__publicField$d(this, "layer", []);
|
|
22629
|
+
__publicField$d(this, "_removed", false);
|
|
22630
|
+
__publicField$d(this, "_creatingInProgress", false);
|
|
22042
22631
|
}
|
|
22043
22632
|
addLayer() {
|
|
22044
22633
|
return this.layer;
|
|
@@ -22166,26 +22755,26 @@ var NgwLeaflet = (function () {
|
|
|
22166
22755
|
|
|
22167
22756
|
const WEBMAP_BASELAYER_ID_PREFIX = "webmap-baselayer";
|
|
22168
22757
|
|
|
22169
|
-
var __defProp$
|
|
22758
|
+
var __defProp$g = Object.defineProperty;
|
|
22170
22759
|
var __defProps$6 = Object.defineProperties;
|
|
22171
22760
|
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
22172
22761
|
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
22173
22762
|
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
22174
22763
|
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
22175
|
-
var __defNormalProp$
|
|
22764
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22176
22765
|
var __spreadValues$8 = (a, b) => {
|
|
22177
22766
|
for (var prop in b || (b = {}))
|
|
22178
22767
|
if (__hasOwnProp$9.call(b, prop))
|
|
22179
|
-
__defNormalProp$
|
|
22768
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
22180
22769
|
if (__getOwnPropSymbols$9)
|
|
22181
22770
|
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
22182
22771
|
if (__propIsEnum$9.call(b, prop))
|
|
22183
|
-
__defNormalProp$
|
|
22772
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
22184
22773
|
}
|
|
22185
22774
|
return a;
|
|
22186
22775
|
};
|
|
22187
22776
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
22188
|
-
var __publicField$
|
|
22777
|
+
var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22189
22778
|
var __async$9 = (__this, __arguments, generator) => {
|
|
22190
22779
|
return new Promise((resolve, reject) => {
|
|
22191
22780
|
var fulfilled = (value) => {
|
|
@@ -22210,21 +22799,20 @@ var NgwLeaflet = (function () {
|
|
|
22210
22799
|
constructor(map, options) {
|
|
22211
22800
|
this.map = map;
|
|
22212
22801
|
this.options = options;
|
|
22213
|
-
__publicField$
|
|
22214
|
-
__publicField$
|
|
22802
|
+
__publicField$c(this, "layer");
|
|
22803
|
+
__publicField$c(this, "NgwWebmapItem", NgwWebmapItem);
|
|
22215
22804
|
/**
|
|
22216
22805
|
* Radius for searching objects in pixels
|
|
22217
22806
|
*/
|
|
22218
|
-
__publicField$
|
|
22807
|
+
__publicField$c(this, "pixelRadius", 10);
|
|
22219
22808
|
// webmapSettings.identify_radius,
|
|
22220
|
-
__publicField$
|
|
22221
|
-
__publicField$
|
|
22222
|
-
__publicField$
|
|
22223
|
-
__publicField$
|
|
22224
|
-
__publicField$
|
|
22225
|
-
__publicField$
|
|
22226
|
-
__publicField$
|
|
22227
|
-
__publicField$b(this, "_lastActiveBaselayer");
|
|
22809
|
+
__publicField$c(this, "resourceId");
|
|
22810
|
+
__publicField$c(this, "webmapClassName", "webmap");
|
|
22811
|
+
__publicField$c(this, "emitter", new EventEmitter());
|
|
22812
|
+
__publicField$c(this, "_extent");
|
|
22813
|
+
__publicField$c(this, "response");
|
|
22814
|
+
__publicField$c(this, "_webmapBaselayersIds", []);
|
|
22815
|
+
__publicField$c(this, "_lastActiveBaselayer");
|
|
22228
22816
|
const r = options.resourceId;
|
|
22229
22817
|
if (Array.isArray(r)) {
|
|
22230
22818
|
this.resourceId = r[0];
|
|
@@ -22267,7 +22855,6 @@ var NgwLeaflet = (function () {
|
|
|
22267
22855
|
}
|
|
22268
22856
|
delete this.layer;
|
|
22269
22857
|
delete this.response;
|
|
22270
|
-
delete this._webmapLayersIds;
|
|
22271
22858
|
}
|
|
22272
22859
|
showLayer() {
|
|
22273
22860
|
return __async$9(this, null, function* () {
|
|
@@ -22358,26 +22945,19 @@ var NgwLeaflet = (function () {
|
|
|
22358
22945
|
getIdentificationIds(options) {
|
|
22359
22946
|
return __async$9(this, null, function* () {
|
|
22360
22947
|
const visibleLayers = [];
|
|
22361
|
-
let
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
const parentId = item.parentId;
|
|
22372
|
-
if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
|
|
22373
|
-
const visible = x.properties.property("visibility");
|
|
22374
|
-
const isVisible = visible.get() && !visible.isBlocked();
|
|
22375
|
-
if (isVisible) {
|
|
22376
|
-
visibleLayers.push(parentId);
|
|
22377
|
-
}
|
|
22948
|
+
let deps = this.getDependLayers();
|
|
22949
|
+
deps = deps.sort((a, b) => b.id - a.id);
|
|
22950
|
+
deps.forEach((x) => {
|
|
22951
|
+
const item = x.item;
|
|
22952
|
+
const parentId = item.style_parent_id;
|
|
22953
|
+
if (parentId !== void 0 && item.item_type === "layer" && item.layer_identifiable) {
|
|
22954
|
+
const visible = x.properties.property("visibility");
|
|
22955
|
+
const isVisible = visible.get() && !visible.isBlocked();
|
|
22956
|
+
if (isVisible) {
|
|
22957
|
+
visibleLayers.push(parentId);
|
|
22378
22958
|
}
|
|
22379
|
-
}
|
|
22380
|
-
}
|
|
22959
|
+
}
|
|
22960
|
+
});
|
|
22381
22961
|
return visibleLayers;
|
|
22382
22962
|
});
|
|
22383
22963
|
}
|
|
@@ -22506,50 +23086,25 @@ var NgwLeaflet = (function () {
|
|
|
22506
23086
|
}
|
|
22507
23087
|
return item;
|
|
22508
23088
|
}
|
|
22509
|
-
_getWebMapIds(options) {
|
|
22510
|
-
return __async$9(this, null, function* () {
|
|
22511
|
-
const webMapItem = this.layer;
|
|
22512
|
-
if (webMapItem && webMapItem.item.item_type === "root") {
|
|
22513
|
-
const layers = webMapItem.tree.getDescendants();
|
|
22514
|
-
const promises = [];
|
|
22515
|
-
for (const x of layers) {
|
|
22516
|
-
const item = x.item;
|
|
22517
|
-
if (item.item_type === "layer") {
|
|
22518
|
-
const id = item.layer_style_id;
|
|
22519
|
-
const promise = this.options.connector.getResource(id, options).then((y) => {
|
|
22520
|
-
if (y) {
|
|
22521
|
-
const parentId = Number(y.resource.parent.id);
|
|
22522
|
-
item.parentId = parentId;
|
|
22523
|
-
return parentId;
|
|
22524
|
-
}
|
|
22525
|
-
});
|
|
22526
|
-
promises.push(promise);
|
|
22527
|
-
}
|
|
22528
|
-
}
|
|
22529
|
-
const ids = yield Promise.all(promises);
|
|
22530
|
-
return ids.filter((x) => x !== void 0);
|
|
22531
|
-
}
|
|
22532
|
-
});
|
|
22533
|
-
}
|
|
22534
23089
|
}
|
|
22535
23090
|
|
|
22536
|
-
var __defProp$
|
|
23091
|
+
var __defProp$f = Object.defineProperty;
|
|
22537
23092
|
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
22538
23093
|
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
22539
23094
|
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
22540
|
-
var __defNormalProp$
|
|
23095
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22541
23096
|
var __spreadValues$7 = (a, b) => {
|
|
22542
23097
|
for (var prop in b || (b = {}))
|
|
22543
23098
|
if (__hasOwnProp$8.call(b, prop))
|
|
22544
|
-
__defNormalProp$
|
|
23099
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
22545
23100
|
if (__getOwnPropSymbols$8)
|
|
22546
23101
|
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
22547
23102
|
if (__propIsEnum$8.call(b, prop))
|
|
22548
|
-
__defNormalProp$
|
|
23103
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
22549
23104
|
}
|
|
22550
23105
|
return a;
|
|
22551
23106
|
};
|
|
22552
|
-
var __publicField$
|
|
23107
|
+
var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22553
23108
|
var __async$8 = (__this, __arguments, generator) => {
|
|
22554
23109
|
return new Promise((resolve, reject) => {
|
|
22555
23110
|
var fulfilled = (value) => {
|
|
@@ -22573,9 +23128,9 @@ var NgwLeaflet = (function () {
|
|
|
22573
23128
|
class NgwKit {
|
|
22574
23129
|
constructor(options) {
|
|
22575
23130
|
this.options = options;
|
|
22576
|
-
__publicField$
|
|
22577
|
-
__publicField$
|
|
22578
|
-
__publicField$
|
|
23131
|
+
__publicField$b(this, "url");
|
|
23132
|
+
__publicField$b(this, "connector");
|
|
23133
|
+
__publicField$b(this, "webMap");
|
|
22579
23134
|
if (this.options.connector) {
|
|
22580
23135
|
this.url = this.options.connector.options.baseUrl || "";
|
|
22581
23136
|
this.connector = this.options.connector;
|
|
@@ -22585,7 +23140,7 @@ var NgwLeaflet = (function () {
|
|
|
22585
23140
|
} else {
|
|
22586
23141
|
throw new Error("url is not defined");
|
|
22587
23142
|
}
|
|
22588
|
-
this.connector = new
|
|
23143
|
+
this.connector = new NgwConnectorExtended({
|
|
22589
23144
|
baseUrl: this.url,
|
|
22590
23145
|
auth: this.options.auth
|
|
22591
23146
|
});
|
|
@@ -22636,37 +23191,37 @@ var NgwLeaflet = (function () {
|
|
|
22636
23191
|
}
|
|
22637
23192
|
}
|
|
22638
23193
|
|
|
22639
|
-
var __defProp$
|
|
23194
|
+
var __defProp$e = Object.defineProperty;
|
|
22640
23195
|
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
22641
23196
|
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
22642
23197
|
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
22643
|
-
var __defNormalProp$
|
|
23198
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22644
23199
|
var __spreadValues$6 = (a, b) => {
|
|
22645
23200
|
for (var prop in b || (b = {}))
|
|
22646
23201
|
if (__hasOwnProp$7.call(b, prop))
|
|
22647
|
-
__defNormalProp$
|
|
23202
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
22648
23203
|
if (__getOwnPropSymbols$7)
|
|
22649
23204
|
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
22650
23205
|
if (__propIsEnum$7.call(b, prop))
|
|
22651
|
-
__defNormalProp$
|
|
23206
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
22652
23207
|
}
|
|
22653
23208
|
return a;
|
|
22654
23209
|
};
|
|
22655
|
-
var __publicField$
|
|
23210
|
+
var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22656
23211
|
class IdentifyItem {
|
|
22657
23212
|
constructor(options) {
|
|
22658
|
-
__publicField$
|
|
22659
|
-
__publicField$
|
|
22660
|
-
__publicField$
|
|
22661
|
-
__publicField$
|
|
22662
|
-
__publicField$
|
|
22663
|
-
__publicField$
|
|
22664
|
-
__publicField$
|
|
22665
|
-
__publicField$
|
|
22666
|
-
__publicField$
|
|
22667
|
-
__publicField$
|
|
22668
|
-
__publicField$
|
|
22669
|
-
__publicField$
|
|
23213
|
+
__publicField$a(this, "id");
|
|
23214
|
+
__publicField$a(this, "label");
|
|
23215
|
+
__publicField$a(this, "layerId");
|
|
23216
|
+
__publicField$a(this, "parent");
|
|
23217
|
+
__publicField$a(this, "fields");
|
|
23218
|
+
__publicField$a(this, "geom");
|
|
23219
|
+
__publicField$a(this, "extensions");
|
|
23220
|
+
__publicField$a(this, "connector");
|
|
23221
|
+
__publicField$a(this, "_item");
|
|
23222
|
+
__publicField$a(this, "_geojson");
|
|
23223
|
+
__publicField$a(this, "_resource");
|
|
23224
|
+
__publicField$a(this, "_extent");
|
|
22670
23225
|
const f = options.feature;
|
|
22671
23226
|
this.id = f.id;
|
|
22672
23227
|
this.geom = f.geom;
|
|
@@ -22752,21 +23307,21 @@ var NgwLeaflet = (function () {
|
|
|
22752
23307
|
});
|
|
22753
23308
|
}
|
|
22754
23309
|
|
|
22755
|
-
var __defProp$
|
|
23310
|
+
var __defProp$d = Object.defineProperty;
|
|
22756
23311
|
var __defProps$5 = Object.defineProperties;
|
|
22757
23312
|
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
22758
23313
|
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
22759
23314
|
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
22760
23315
|
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
22761
|
-
var __defNormalProp$
|
|
23316
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22762
23317
|
var __spreadValues$5 = (a, b) => {
|
|
22763
23318
|
for (var prop in b || (b = {}))
|
|
22764
23319
|
if (__hasOwnProp$6.call(b, prop))
|
|
22765
|
-
__defNormalProp$
|
|
23320
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
22766
23321
|
if (__getOwnPropSymbols$6)
|
|
22767
23322
|
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
22768
23323
|
if (__propIsEnum$6.call(b, prop))
|
|
22769
|
-
__defNormalProp$
|
|
23324
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
22770
23325
|
}
|
|
22771
23326
|
return a;
|
|
22772
23327
|
};
|
|
@@ -22970,95 +23525,95 @@ var NgwLeaflet = (function () {
|
|
|
22970
23525
|
});
|
|
22971
23526
|
}
|
|
22972
23527
|
|
|
22973
|
-
var __defProp$
|
|
22974
|
-
var __defNormalProp$
|
|
22975
|
-
var __publicField$
|
|
23528
|
+
var __defProp$c = Object.defineProperty;
|
|
23529
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23530
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22976
23531
|
class KeyCodes {
|
|
22977
23532
|
constructor() {
|
|
22978
|
-
__publicField$
|
|
22979
|
-
__publicField$
|
|
22980
|
-
__publicField$
|
|
22981
|
-
__publicField$
|
|
22982
|
-
__publicField$
|
|
22983
|
-
__publicField$
|
|
22984
|
-
__publicField$
|
|
22985
|
-
__publicField$
|
|
22986
|
-
__publicField$
|
|
22987
|
-
__publicField$
|
|
22988
|
-
__publicField$
|
|
22989
|
-
__publicField$
|
|
22990
|
-
__publicField$
|
|
22991
|
-
__publicField$
|
|
22992
|
-
__publicField$
|
|
22993
|
-
__publicField$
|
|
22994
|
-
__publicField$
|
|
22995
|
-
__publicField$
|
|
22996
|
-
__publicField$
|
|
22997
|
-
__publicField$
|
|
22998
|
-
__publicField$
|
|
22999
|
-
__publicField$
|
|
23000
|
-
__publicField$
|
|
23001
|
-
__publicField$
|
|
23002
|
-
__publicField$
|
|
23003
|
-
__publicField$
|
|
23004
|
-
__publicField$
|
|
23005
|
-
__publicField$
|
|
23006
|
-
__publicField$
|
|
23007
|
-
__publicField$
|
|
23008
|
-
__publicField$
|
|
23009
|
-
__publicField$
|
|
23010
|
-
__publicField$
|
|
23011
|
-
__publicField$
|
|
23012
|
-
__publicField$
|
|
23013
|
-
__publicField$
|
|
23014
|
-
__publicField$
|
|
23015
|
-
__publicField$
|
|
23016
|
-
__publicField$
|
|
23017
|
-
__publicField$
|
|
23018
|
-
__publicField$
|
|
23019
|
-
__publicField$
|
|
23020
|
-
__publicField$
|
|
23021
|
-
__publicField$
|
|
23022
|
-
__publicField$
|
|
23023
|
-
__publicField$
|
|
23024
|
-
__publicField$
|
|
23025
|
-
__publicField$
|
|
23026
|
-
__publicField$
|
|
23027
|
-
__publicField$
|
|
23028
|
-
__publicField$
|
|
23029
|
-
__publicField$
|
|
23030
|
-
__publicField$
|
|
23031
|
-
__publicField$
|
|
23533
|
+
__publicField$9(this, "backspace", 8);
|
|
23534
|
+
__publicField$9(this, "tab", 9);
|
|
23535
|
+
__publicField$9(this, "enter", 13);
|
|
23536
|
+
__publicField$9(this, "shift", 16);
|
|
23537
|
+
__publicField$9(this, "ctrl", 17);
|
|
23538
|
+
__publicField$9(this, "alt", 18);
|
|
23539
|
+
__publicField$9(this, "pause/break", 19);
|
|
23540
|
+
__publicField$9(this, "caps_lock", 20);
|
|
23541
|
+
__publicField$9(this, "escape", 27);
|
|
23542
|
+
__publicField$9(this, "page_up", 33);
|
|
23543
|
+
__publicField$9(this, "page_down", 34);
|
|
23544
|
+
__publicField$9(this, "end", 35);
|
|
23545
|
+
__publicField$9(this, "home", 36);
|
|
23546
|
+
__publicField$9(this, "left_arrow", 37);
|
|
23547
|
+
__publicField$9(this, "up_arrow", 38);
|
|
23548
|
+
__publicField$9(this, "right_arrow", 39);
|
|
23549
|
+
__publicField$9(this, "down_arrow", 40);
|
|
23550
|
+
__publicField$9(this, "insert", 45);
|
|
23551
|
+
__publicField$9(this, "delete", 46);
|
|
23552
|
+
__publicField$9(this, "left_window_key", 91);
|
|
23553
|
+
__publicField$9(this, "right_window_key", 92);
|
|
23554
|
+
__publicField$9(this, "select_key", 93);
|
|
23555
|
+
__publicField$9(this, "numpad_0", 96);
|
|
23556
|
+
__publicField$9(this, "numpad_1", 97);
|
|
23557
|
+
__publicField$9(this, "numpad_2", 98);
|
|
23558
|
+
__publicField$9(this, "numpad_3", 99);
|
|
23559
|
+
__publicField$9(this, "numpad_4", 100);
|
|
23560
|
+
__publicField$9(this, "numpad_5", 101);
|
|
23561
|
+
__publicField$9(this, "numpad_6", 102);
|
|
23562
|
+
__publicField$9(this, "numpad_7", 103);
|
|
23563
|
+
__publicField$9(this, "numpad_8", 104);
|
|
23564
|
+
__publicField$9(this, "numpad_9", 105);
|
|
23565
|
+
__publicField$9(this, "multiply", 106);
|
|
23566
|
+
__publicField$9(this, "add", 107);
|
|
23567
|
+
__publicField$9(this, "subtract", 109);
|
|
23568
|
+
__publicField$9(this, "decimal_point", 110);
|
|
23569
|
+
__publicField$9(this, "divide", 111);
|
|
23570
|
+
__publicField$9(this, "f1", 112);
|
|
23571
|
+
__publicField$9(this, "f2", 113);
|
|
23572
|
+
__publicField$9(this, "f3", 114);
|
|
23573
|
+
__publicField$9(this, "f4", 115);
|
|
23574
|
+
__publicField$9(this, "f5", 116);
|
|
23575
|
+
__publicField$9(this, "f6", 117);
|
|
23576
|
+
__publicField$9(this, "f7", 118);
|
|
23577
|
+
__publicField$9(this, "f8", 119);
|
|
23578
|
+
__publicField$9(this, "f9", 120);
|
|
23579
|
+
__publicField$9(this, "f10", 121);
|
|
23580
|
+
__publicField$9(this, "f11", 122);
|
|
23581
|
+
__publicField$9(this, "f12", 123);
|
|
23582
|
+
__publicField$9(this, "num_lock", 144);
|
|
23583
|
+
__publicField$9(this, "scroll_lock", 145);
|
|
23584
|
+
__publicField$9(this, "semi-colon", 186);
|
|
23585
|
+
__publicField$9(this, "equal_sign", 187);
|
|
23586
|
+
__publicField$9(this, ",", 188);
|
|
23032
23587
|
// "comma";
|
|
23033
|
-
__publicField$
|
|
23588
|
+
__publicField$9(this, "-", 189);
|
|
23034
23589
|
// "dash";
|
|
23035
|
-
__publicField$
|
|
23590
|
+
__publicField$9(this, ".", 190);
|
|
23036
23591
|
// "period";
|
|
23037
|
-
__publicField$
|
|
23592
|
+
__publicField$9(this, "/", 191);
|
|
23038
23593
|
// "forward slash";
|
|
23039
|
-
__publicField$
|
|
23594
|
+
__publicField$9(this, "`", 192);
|
|
23040
23595
|
// "grave accent";
|
|
23041
|
-
__publicField$
|
|
23596
|
+
__publicField$9(this, "[", 219);
|
|
23042
23597
|
// "open bracket";
|
|
23043
|
-
__publicField$
|
|
23598
|
+
__publicField$9(this, "\\", 220);
|
|
23044
23599
|
// "back slash";
|
|
23045
|
-
__publicField$
|
|
23600
|
+
__publicField$9(this, "]", 221);
|
|
23046
23601
|
// "close braket";
|
|
23047
|
-
__publicField$
|
|
23602
|
+
__publicField$9(this, "'", 222);
|
|
23048
23603
|
}
|
|
23049
23604
|
// "single quote"
|
|
23050
23605
|
}
|
|
23051
23606
|
|
|
23052
|
-
var __defProp$
|
|
23053
|
-
var __defNormalProp$
|
|
23054
|
-
var __publicField$
|
|
23607
|
+
var __defProp$b = Object.defineProperty;
|
|
23608
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23609
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23055
23610
|
class Keys {
|
|
23056
23611
|
constructor() {
|
|
23057
|
-
__publicField$
|
|
23058
|
-
__publicField$
|
|
23059
|
-
__publicField$
|
|
23060
|
-
__publicField$
|
|
23061
|
-
__publicField$
|
|
23612
|
+
__publicField$8(this, "keyCodeAlias", new KeyCodes());
|
|
23613
|
+
__publicField$8(this, "keys", {});
|
|
23614
|
+
__publicField$8(this, "_windowOnFocus");
|
|
23615
|
+
__publicField$8(this, "_keysPressed");
|
|
23616
|
+
__publicField$8(this, "_keysReleased");
|
|
23062
23617
|
this._windowOnFocus = this.windowOnFocus.bind(this);
|
|
23063
23618
|
this._keysPressed = this.keysPressed.bind(this);
|
|
23064
23619
|
this._keysReleased = this.keysReleased.bind(this);
|
|
@@ -23097,15 +23652,15 @@ var NgwLeaflet = (function () {
|
|
|
23097
23652
|
}
|
|
23098
23653
|
}
|
|
23099
23654
|
|
|
23100
|
-
var __defProp$
|
|
23101
|
-
var __defNormalProp$
|
|
23102
|
-
var __publicField$
|
|
23655
|
+
var __defProp$a = Object.defineProperty;
|
|
23656
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23657
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23103
23658
|
class StateItem {
|
|
23104
23659
|
constructor(webMap, opt) {
|
|
23105
23660
|
this.webMap = webMap;
|
|
23106
|
-
__publicField$
|
|
23107
|
-
__publicField$
|
|
23108
|
-
__publicField$
|
|
23661
|
+
__publicField$7(this, "name");
|
|
23662
|
+
__publicField$7(this, "event");
|
|
23663
|
+
__publicField$7(this, "value");
|
|
23109
23664
|
if (opt) {
|
|
23110
23665
|
if (opt.value) {
|
|
23111
23666
|
this.setValue(opt.value);
|
|
@@ -23114,7 +23669,11 @@ var NgwLeaflet = (function () {
|
|
|
23114
23669
|
this.name = opt.name;
|
|
23115
23670
|
}
|
|
23116
23671
|
if (opt.event) {
|
|
23117
|
-
|
|
23672
|
+
if (typeof opt.event === "string") {
|
|
23673
|
+
this.event = [opt.event];
|
|
23674
|
+
} else {
|
|
23675
|
+
this.event = opt.event;
|
|
23676
|
+
}
|
|
23118
23677
|
}
|
|
23119
23678
|
}
|
|
23120
23679
|
}
|
|
@@ -23126,6 +23685,34 @@ var NgwLeaflet = (function () {
|
|
|
23126
23685
|
}
|
|
23127
23686
|
}
|
|
23128
23687
|
|
|
23688
|
+
var __defProp$9 = Object.defineProperty;
|
|
23689
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23690
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23691
|
+
class BoundState extends StateItem {
|
|
23692
|
+
constructor() {
|
|
23693
|
+
super(...arguments);
|
|
23694
|
+
__publicField$6(this, "name", "bounds");
|
|
23695
|
+
__publicField$6(this, "event", ["moveend"]);
|
|
23696
|
+
}
|
|
23697
|
+
getValue() {
|
|
23698
|
+
return this.webMap.getBounds();
|
|
23699
|
+
}
|
|
23700
|
+
setValue(bounds) {
|
|
23701
|
+
this.webMap.setView({ bounds });
|
|
23702
|
+
}
|
|
23703
|
+
toString() {
|
|
23704
|
+
const data = this.getValue();
|
|
23705
|
+
if (data) {
|
|
23706
|
+
return data.slice(0, 4).map((x) => x.toFixed(5)).join("_");
|
|
23707
|
+
}
|
|
23708
|
+
return void 0;
|
|
23709
|
+
}
|
|
23710
|
+
parse(str) {
|
|
23711
|
+
const lngLat = str.split("_").map(Number);
|
|
23712
|
+
return lngLat;
|
|
23713
|
+
}
|
|
23714
|
+
}
|
|
23715
|
+
|
|
23129
23716
|
var __defProp$8 = Object.defineProperty;
|
|
23130
23717
|
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23131
23718
|
var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -23133,7 +23720,7 @@ var NgwLeaflet = (function () {
|
|
|
23133
23720
|
constructor() {
|
|
23134
23721
|
super(...arguments);
|
|
23135
23722
|
__publicField$5(this, "name", "center");
|
|
23136
|
-
__publicField$5(this, "event", "moveend");
|
|
23723
|
+
__publicField$5(this, "event", ["moveend"]);
|
|
23137
23724
|
}
|
|
23138
23725
|
getValue() {
|
|
23139
23726
|
return this.webMap.getCenter();
|
|
@@ -23141,9 +23728,13 @@ var NgwLeaflet = (function () {
|
|
|
23141
23728
|
setValue(val) {
|
|
23142
23729
|
this.webMap.setCenter(val);
|
|
23143
23730
|
}
|
|
23144
|
-
toString(
|
|
23145
|
-
const
|
|
23146
|
-
|
|
23731
|
+
toString() {
|
|
23732
|
+
const data = this.getValue();
|
|
23733
|
+
if (data) {
|
|
23734
|
+
const d = data.map((x) => x.toFixed(5));
|
|
23735
|
+
return d[0] + "_" + d[1];
|
|
23736
|
+
}
|
|
23737
|
+
return "";
|
|
23147
23738
|
}
|
|
23148
23739
|
parse(str) {
|
|
23149
23740
|
const lngLat = str.split("_").map(Number);
|
|
@@ -23158,7 +23749,7 @@ var NgwLeaflet = (function () {
|
|
|
23158
23749
|
constructor() {
|
|
23159
23750
|
super(...arguments);
|
|
23160
23751
|
__publicField$4(this, "name", "zoom");
|
|
23161
|
-
__publicField$4(this, "event", "zoomend");
|
|
23752
|
+
__publicField$4(this, "event", ["zoomend"]);
|
|
23162
23753
|
}
|
|
23163
23754
|
getValue() {
|
|
23164
23755
|
const zoom = this.webMap.getZoom();
|
|
@@ -23167,8 +23758,8 @@ var NgwLeaflet = (function () {
|
|
|
23167
23758
|
setValue(val) {
|
|
23168
23759
|
this.webMap.setZoom(val);
|
|
23169
23760
|
}
|
|
23170
|
-
toString(
|
|
23171
|
-
return String(
|
|
23761
|
+
toString() {
|
|
23762
|
+
return String(this.getValue());
|
|
23172
23763
|
}
|
|
23173
23764
|
parse(str) {
|
|
23174
23765
|
return Number(str);
|
|
@@ -23237,14 +23828,14 @@ var NgwLeaflet = (function () {
|
|
|
23237
23828
|
__publicField$3(this, "mapAdapter");
|
|
23238
23829
|
__publicField$3(this, "runtimeParams", []);
|
|
23239
23830
|
__publicField$3(this, "getPaintFunctions", _WebMapMain.getPaintFunctions);
|
|
23240
|
-
__publicField$3(this, "
|
|
23831
|
+
__publicField$3(this, "mapStateItems", [CenterState, ZoomState, BoundState]);
|
|
23241
23832
|
__publicField$3(this, "id", ID++);
|
|
23242
23833
|
/**
|
|
23243
23834
|
* From runtime params
|
|
23244
23835
|
*/
|
|
23836
|
+
__publicField$3(this, "mapState", []);
|
|
23245
23837
|
__publicField$3(this, "_initMapState", {});
|
|
23246
23838
|
__publicField$3(this, "_starterKits");
|
|
23247
|
-
__publicField$3(this, "_mapState", []);
|
|
23248
23839
|
__publicField$3(this, "_extent");
|
|
23249
23840
|
__publicField$3(this, "_eventsStatus", {});
|
|
23250
23841
|
__publicField$3(this, "_coordFromMapClickAbort");
|
|
@@ -23279,7 +23870,7 @@ var NgwLeaflet = (function () {
|
|
|
23279
23870
|
create() {
|
|
23280
23871
|
return __async$5(this, null, function* () {
|
|
23281
23872
|
if (!this.getEventStatus("create")) {
|
|
23282
|
-
yield this._setInitMapState(this.
|
|
23873
|
+
yield this._setInitMapState(this.mapStateItems);
|
|
23283
23874
|
yield this._setupMap();
|
|
23284
23875
|
this._emitStatusEvent("create", this);
|
|
23285
23876
|
}
|
|
@@ -23299,16 +23890,22 @@ var NgwLeaflet = (function () {
|
|
|
23299
23890
|
this.mapAdapter.destroy();
|
|
23300
23891
|
}
|
|
23301
23892
|
}
|
|
23302
|
-
|
|
23893
|
+
mapStateWithFunc(func) {
|
|
23303
23894
|
const state = {};
|
|
23304
|
-
this.
|
|
23305
|
-
state[x.name] = x
|
|
23895
|
+
this.mapState.forEach((x) => {
|
|
23896
|
+
state[x.name] = func(x);
|
|
23306
23897
|
});
|
|
23307
23898
|
return state;
|
|
23308
23899
|
}
|
|
23900
|
+
getStateAsString() {
|
|
23901
|
+
return this.mapStateWithFunc((x) => x.toString());
|
|
23902
|
+
}
|
|
23903
|
+
getState() {
|
|
23904
|
+
return this.mapStateWithFunc((x) => x.getValue());
|
|
23905
|
+
}
|
|
23309
23906
|
getRuntimeParams() {
|
|
23310
23907
|
const state = {};
|
|
23311
|
-
this.
|
|
23908
|
+
this.mapState.forEach((x) => {
|
|
23312
23909
|
for (const r of this.runtimeParams) {
|
|
23313
23910
|
const val = r.get(x.name);
|
|
23314
23911
|
if (val !== void 0) {
|
|
@@ -23650,7 +24247,7 @@ var NgwLeaflet = (function () {
|
|
|
23650
24247
|
_setInitMapState(states) {
|
|
23651
24248
|
for (const X of states) {
|
|
23652
24249
|
const state = new X(this);
|
|
23653
|
-
this.
|
|
24250
|
+
this.mapState.push(state);
|
|
23654
24251
|
for (const r of this.runtimeParams) {
|
|
23655
24252
|
const str = r.get(state.name);
|
|
23656
24253
|
if (str !== void 0) {
|
|
@@ -23686,13 +24283,15 @@ var NgwLeaflet = (function () {
|
|
|
23686
24283
|
events.forEach((x) => {
|
|
23687
24284
|
this._mapEvents[x] = (data) => {
|
|
23688
24285
|
if (this.runtimeParams.length) {
|
|
23689
|
-
const
|
|
23690
|
-
|
|
23691
|
-
|
|
24286
|
+
const mapStatusEvents = this.mapState.filter(
|
|
24287
|
+
(y) => y.event.includes(x)
|
|
24288
|
+
);
|
|
24289
|
+
mapStatusEvents.forEach((mapStatusEvent) => {
|
|
24290
|
+
const value = mapStatusEvent.toString();
|
|
23692
24291
|
this.runtimeParams.forEach((r) => {
|
|
23693
24292
|
r.set(mapStatusEvent.name, value);
|
|
23694
24293
|
});
|
|
23695
|
-
}
|
|
24294
|
+
});
|
|
23696
24295
|
}
|
|
23697
24296
|
if (this._eventsStatus) {
|
|
23698
24297
|
this.emitter.emit(x, data);
|
|
@@ -24268,11 +24867,11 @@ var NgwLeaflet = (function () {
|
|
|
24268
24867
|
}
|
|
24269
24868
|
return Promise.resolve();
|
|
24270
24869
|
}
|
|
24271
|
-
updateLayer(layerDef) {
|
|
24870
|
+
updateLayer(layerDef, options) {
|
|
24272
24871
|
const layer = this.getLayer(layerDef);
|
|
24273
24872
|
if (layer) {
|
|
24274
24873
|
if (layer.updateLayer) {
|
|
24275
|
-
return Promise.resolve(layer.updateLayer());
|
|
24874
|
+
return Promise.resolve(layer.updateLayer(options));
|
|
24276
24875
|
} else if (this.isLayerVisible(layer)) {
|
|
24277
24876
|
return this.hideLayer(layer, { silent: true }).then(() => {
|
|
24278
24877
|
return this.showLayer(layer, { silent: true });
|
|
@@ -25162,7 +25761,7 @@ var NgwLeaflet = (function () {
|
|
|
25162
25761
|
});
|
|
25163
25762
|
}
|
|
25164
25763
|
if (!options.connector) {
|
|
25165
|
-
options.connector = new
|
|
25764
|
+
options.connector = new NgwConnectorExtended({
|
|
25166
25765
|
baseUrl: options.baseUrl || "",
|
|
25167
25766
|
auth: options.auth,
|
|
25168
25767
|
withCredentials: options.withCredentials
|
|
@@ -25436,7 +26035,7 @@ var NgwLeaflet = (function () {
|
|
|
25436
26035
|
if (mem.layer.getDependLayers) {
|
|
25437
26036
|
const dependLayers = mem.layer.getDependLayers();
|
|
25438
26037
|
const dependFit = dependLayers.find((x) => {
|
|
25439
|
-
return x.item && x.item.
|
|
26038
|
+
return x.item && x.item.style_parent_id === id;
|
|
25440
26039
|
});
|
|
25441
26040
|
if (dependFit) {
|
|
25442
26041
|
return dependFit.layer;
|