@nextgis/geocoder 3.0.0-alpha.15 → 3.0.0-alpha.17
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/geocoder.cjs.js +1 -1
- package/lib/geocoder.esm-browser.js +17 -18
- package/lib/geocoder.esm-browser.js.map +1 -1
- package/lib/geocoder.esm-browser.prod.js +1 -1
- package/lib/geocoder.esm-browser.prod.js.map +1 -1
- package/lib/geocoder.esm-bundler.js +1 -1
- package/lib/geocoder.global.js +17 -18
- package/lib/geocoder.global.js.map +1 -1
- package/lib/geocoder.global.prod.js +1 -1
- package/lib/geocoder.global.prod.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.16; author: NextGIS */
|
|
2
2
|
import { objectAssign, fixUrlStr } from '@nextgis/utils';
|
|
3
3
|
import NgwConnector from '@nextgis/ngw-connector';
|
|
4
4
|
import { fetchNgwLayerItems } from '@nextgis/ngw-kit';
|
package/lib/geocoder.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.16; author: NextGIS */
|
|
2
2
|
var Geocoder = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1020,7 +1020,7 @@ var Geocoder = (function (exports) {
|
|
|
1020
1020
|
|
|
1021
1021
|
var pkg = {
|
|
1022
1022
|
name: "@nextgis/ngw-connector",
|
|
1023
|
-
version: "3.0.0-alpha.
|
|
1023
|
+
version: "3.0.0-alpha.16",
|
|
1024
1024
|
_priority: 12,
|
|
1025
1025
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
1026
1026
|
main: "index.js",
|
|
@@ -1512,7 +1512,10 @@ var Geocoder = (function (exports) {
|
|
|
1512
1512
|
});
|
|
1513
1513
|
}
|
|
1514
1514
|
} else {
|
|
1515
|
-
|
|
1515
|
+
const ignoredForClean = ["api/feature_layer/identify"];
|
|
1516
|
+
if (ignoredForClean.every((part) => !path.includes(part))) {
|
|
1517
|
+
cacheEngine.clean();
|
|
1518
|
+
}
|
|
1516
1519
|
}
|
|
1517
1520
|
}
|
|
1518
1521
|
return makeRequest();
|
|
@@ -1818,12 +1821,16 @@ var Geocoder = (function (exports) {
|
|
|
1818
1821
|
__publicField$4(this, "user");
|
|
1819
1822
|
__publicField$4(this, "cache");
|
|
1820
1823
|
__publicField$4(this, "withCredentials");
|
|
1824
|
+
// Dedicated cache for route requests, as these are executed before any other requests.
|
|
1825
|
+
// This cache does not need to be cleared during the session.
|
|
1826
|
+
__publicField$4(this, "routeCache");
|
|
1821
1827
|
__publicField$4(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
1822
1828
|
__publicField$4(this, "routeStr", "/api/component/pyramid/route");
|
|
1823
1829
|
__publicField$4(this, "activeRequests", {});
|
|
1824
1830
|
__publicField$4(this, "requestTransform");
|
|
1825
1831
|
const exist = findConnector(options);
|
|
1826
1832
|
this.cache = new Cache({ namespace: options.cacheId });
|
|
1833
|
+
this.routeCache = new Cache({ namespace: "routecache" });
|
|
1827
1834
|
if (exist) {
|
|
1828
1835
|
return exist;
|
|
1829
1836
|
} else {
|
|
@@ -1884,19 +1891,9 @@ var Geocoder = (function (exports) {
|
|
|
1884
1891
|
}
|
|
1885
1892
|
}
|
|
1886
1893
|
const routeUrl = `${this.routeStr}?client=${this.client}`;
|
|
1887
|
-
return this.
|
|
1888
|
-
|
|
1889
|
-
{}
|
|
1890
|
-
{
|
|
1891
|
-
cacheName: "route",
|
|
1892
|
-
signal,
|
|
1893
|
-
cache: true,
|
|
1894
|
-
cacheProps: {
|
|
1895
|
-
id: this.id,
|
|
1896
|
-
auth,
|
|
1897
|
-
baseUrl: this.options.baseUrl
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1894
|
+
return this.routeCache.add(
|
|
1895
|
+
this.options.baseUrl || String(this.id),
|
|
1896
|
+
() => this.makeQuery(routeUrl, null, { signal, cache: false })
|
|
1900
1897
|
);
|
|
1901
1898
|
});
|
|
1902
1899
|
}
|
|
@@ -1917,6 +1914,7 @@ var Geocoder = (function (exports) {
|
|
|
1917
1914
|
removeConnector(this);
|
|
1918
1915
|
this.options.auth = void 0;
|
|
1919
1916
|
this.user = void 0;
|
|
1917
|
+
this.routeCache.clean();
|
|
1920
1918
|
this.clearCache();
|
|
1921
1919
|
this.emitter.emit("logout");
|
|
1922
1920
|
}
|
|
@@ -2023,7 +2021,7 @@ var Geocoder = (function (exports) {
|
|
|
2023
2021
|
this._cleanActiveRequest(id);
|
|
2024
2022
|
}
|
|
2025
2023
|
});
|
|
2026
|
-
if (method === "GET") {
|
|
2024
|
+
if (method === "GET" && cache !== false) {
|
|
2027
2025
|
const cacheOptions = cacheProps ? cacheProps : __spreadProps$3(__spreadValues$4({}, objectRemoveEmpty({
|
|
2028
2026
|
headers,
|
|
2029
2027
|
withCredentials,
|
|
@@ -2749,7 +2747,8 @@ var Geocoder = (function (exports) {
|
|
|
2749
2747
|
};
|
|
2750
2748
|
const FEATURE_REQUEST_PARAMS = {
|
|
2751
2749
|
srs: 4326,
|
|
2752
|
-
geom_format: "geojson"
|
|
2750
|
+
geom_format: "geojson",
|
|
2751
|
+
dt_format: "iso"
|
|
2753
2752
|
};
|
|
2754
2753
|
function updateItemRequestParam(params, options) {
|
|
2755
2754
|
const { extensions, geom, fields, srs, ilike, like } = options;
|