@nextgis/ngw-leaflet 3.0.0-alpha.14 → 3.0.0-alpha.16
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 +41 -37
- 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 +41 -37
- 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 +3 -3
|
@@ -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.16; author: NextGIS */
|
|
2
2
|
var domain;
|
|
3
3
|
|
|
4
4
|
// This constructor is used to store event handlers. Instantiating this is
|
|
@@ -18190,7 +18190,7 @@ let Cache = _Cache;
|
|
|
18190
18190
|
|
|
18191
18191
|
var pkg = {
|
|
18192
18192
|
name: "@nextgis/ngw-connector",
|
|
18193
|
-
version: "3.0.0-alpha.
|
|
18193
|
+
version: "3.0.0-alpha.16",
|
|
18194
18194
|
_priority: 12,
|
|
18195
18195
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
18196
18196
|
main: "index.js",
|
|
@@ -18682,7 +18682,10 @@ function request(path, options, cacheEngine) {
|
|
|
18682
18682
|
});
|
|
18683
18683
|
}
|
|
18684
18684
|
} else {
|
|
18685
|
-
|
|
18685
|
+
const ignoredForClean = ["api/feature_layer/identify"];
|
|
18686
|
+
if (ignoredForClean.every((part) => !path.includes(part))) {
|
|
18687
|
+
cacheEngine.clean();
|
|
18688
|
+
}
|
|
18686
18689
|
}
|
|
18687
18690
|
}
|
|
18688
18691
|
return makeRequest();
|
|
@@ -18988,12 +18991,16 @@ class NgwConnector {
|
|
|
18988
18991
|
__publicField$s(this, "user");
|
|
18989
18992
|
__publicField$s(this, "cache");
|
|
18990
18993
|
__publicField$s(this, "withCredentials");
|
|
18994
|
+
// Dedicated cache for route requests, as these are executed before any other requests.
|
|
18995
|
+
// This cache does not need to be cleared during the session.
|
|
18996
|
+
__publicField$s(this, "routeCache");
|
|
18991
18997
|
__publicField$s(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
18992
18998
|
__publicField$s(this, "routeStr", "/api/component/pyramid/route");
|
|
18993
18999
|
__publicField$s(this, "activeRequests", {});
|
|
18994
19000
|
__publicField$s(this, "requestTransform");
|
|
18995
19001
|
const exist = findConnector(options);
|
|
18996
19002
|
this.cache = new Cache({ namespace: options.cacheId });
|
|
19003
|
+
this.routeCache = new Cache({ namespace: "routecache" });
|
|
18997
19004
|
if (exist) {
|
|
18998
19005
|
return exist;
|
|
18999
19006
|
} else {
|
|
@@ -19054,19 +19061,9 @@ class NgwConnector {
|
|
|
19054
19061
|
}
|
|
19055
19062
|
}
|
|
19056
19063
|
const routeUrl = `${this.routeStr}?client=${this.client}`;
|
|
19057
|
-
return this.
|
|
19058
|
-
|
|
19059
|
-
{}
|
|
19060
|
-
{
|
|
19061
|
-
cacheName: "route",
|
|
19062
|
-
signal,
|
|
19063
|
-
cache: true,
|
|
19064
|
-
cacheProps: {
|
|
19065
|
-
id: this.id,
|
|
19066
|
-
auth,
|
|
19067
|
-
baseUrl: this.options.baseUrl
|
|
19068
|
-
}
|
|
19069
|
-
}
|
|
19064
|
+
return this.routeCache.add(
|
|
19065
|
+
this.options.baseUrl || String(this.id),
|
|
19066
|
+
() => this.makeQuery(routeUrl, null, { signal, cache: false })
|
|
19070
19067
|
);
|
|
19071
19068
|
});
|
|
19072
19069
|
}
|
|
@@ -19087,6 +19084,7 @@ class NgwConnector {
|
|
|
19087
19084
|
removeConnector(this);
|
|
19088
19085
|
this.options.auth = void 0;
|
|
19089
19086
|
this.user = void 0;
|
|
19087
|
+
this.routeCache.clean();
|
|
19090
19088
|
this.clearCache();
|
|
19091
19089
|
this.emitter.emit("logout");
|
|
19092
19090
|
}
|
|
@@ -19193,7 +19191,7 @@ class NgwConnector {
|
|
|
19193
19191
|
this._cleanActiveRequest(id);
|
|
19194
19192
|
}
|
|
19195
19193
|
});
|
|
19196
|
-
if (method === "GET") {
|
|
19194
|
+
if (method === "GET" && cache !== false) {
|
|
19197
19195
|
const cacheOptions = cacheProps ? cacheProps : __spreadProps$i(__spreadValues$r({}, objectRemoveEmpty({
|
|
19198
19196
|
headers,
|
|
19199
19197
|
withCredentials,
|
|
@@ -22904,15 +22902,19 @@ function createRasterAdapter(_0) {
|
|
|
22904
22902
|
}
|
|
22905
22903
|
showLayer() {
|
|
22906
22904
|
this._layerVisibility = true;
|
|
22907
|
-
if (this.
|
|
22908
|
-
if (
|
|
22905
|
+
if (!this._blocked) {
|
|
22906
|
+
if (super.showLayer) {
|
|
22907
|
+
super.showLayer(this.layer);
|
|
22908
|
+
} else if (this.layer) {
|
|
22909
22909
|
webMap.mapAdapter.showLayer(this.layer);
|
|
22910
22910
|
}
|
|
22911
22911
|
}
|
|
22912
22912
|
}
|
|
22913
22913
|
hideLayer() {
|
|
22914
22914
|
this._layerVisibility = false;
|
|
22915
|
-
if (
|
|
22915
|
+
if (super.hideLayer) {
|
|
22916
|
+
super.hideLayer(this.layer);
|
|
22917
|
+
} else if (this.layer) {
|
|
22916
22918
|
webMap.mapAdapter.hideLayer(this.layer);
|
|
22917
22919
|
}
|
|
22918
22920
|
}
|
|
@@ -23459,24 +23461,26 @@ function getCompanyLogo(connector, options) {
|
|
|
23459
23461
|
img.style.maxHeight = "100px";
|
|
23460
23462
|
img.style.maxWidth = "100px";
|
|
23461
23463
|
img.src = "";
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
if (logo) {
|
|
23466
|
-
const [mimeType, base64Data] = logo;
|
|
23467
|
-
const byteCharacters = atob(base64Data);
|
|
23468
|
-
const byteNumbers = new Array(byteCharacters.length);
|
|
23469
|
-
for (let i = 0; i < byteCharacters.length; i++) {
|
|
23470
|
-
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
23471
|
-
}
|
|
23472
|
-
const byteArray = new Uint8Array(byteNumbers);
|
|
23473
|
-
const blob = new Blob([byteArray], { type: mimeType });
|
|
23474
|
-
const urlCreator = window.URL || window.webkitURL;
|
|
23475
|
-
const imageUrl = urlCreator.createObjectURL(blob);
|
|
23476
|
-
img.src = imageUrl;
|
|
23464
|
+
const resp = yield connector.route("pyramid.csettings").get({
|
|
23465
|
+
query: {
|
|
23466
|
+
pyramid: ["header_logo"]
|
|
23477
23467
|
}
|
|
23478
|
-
}
|
|
23479
|
-
|
|
23468
|
+
});
|
|
23469
|
+
const logo = (_b = resp.pyramid) == null ? void 0 : _b.header_logo;
|
|
23470
|
+
if (logo) {
|
|
23471
|
+
const [mimeType, base64Data] = logo;
|
|
23472
|
+
const byteCharacters = atob(base64Data);
|
|
23473
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
23474
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
23475
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
23476
|
+
}
|
|
23477
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
23478
|
+
const blob = new Blob([byteArray], { type: mimeType });
|
|
23479
|
+
const urlCreator = window.URL || window.webkitURL;
|
|
23480
|
+
const imageUrl = urlCreator.createObjectURL(blob);
|
|
23481
|
+
img.src = imageUrl;
|
|
23482
|
+
} else {
|
|
23483
|
+
return;
|
|
23480
23484
|
}
|
|
23481
23485
|
if (settings.company_logo.link !== null && settings.company_logo.link.trim() !== "") {
|
|
23482
23486
|
anchor.href = settings.company_logo.link;
|