@nextgis/leaflet-map-adapter 3.0.0-alpha.1 → 3.0.0-alpha.4
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/index.d.ts +0 -1
- package/lib/leaflet-map-adapter.esm-browser.js +33 -7
- package/lib/leaflet-map-adapter.esm-browser.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.js +19 -8
- package/lib/leaflet-map-adapter.esm-bundler.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.global.js +33 -7
- package/lib/leaflet-map-adapter.global.js.map +1 -1
- package/lib/leaflet-map-adapter.global.prod.js +1 -1
- package/lib/leaflet-map-adapter.global.prod.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/leaflet-map-adapter; version: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/leaflet-map-adapter; version: 3.0.0-alpha.4; author: NextGIS */
|
|
2
2
|
var LeafletMapAdapter = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -14656,6 +14656,21 @@ var LeafletMapAdapter = (function () {
|
|
|
14656
14656
|
return wrapper;
|
|
14657
14657
|
}
|
|
14658
14658
|
|
|
14659
|
+
function updateUrlParams(urlStr, params) {
|
|
14660
|
+
const url = new URL(urlStr);
|
|
14661
|
+
const searchParams = new URLSearchParams(url.search);
|
|
14662
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
14663
|
+
if (value === void 0) {
|
|
14664
|
+
searchParams.delete(key);
|
|
14665
|
+
} else {
|
|
14666
|
+
searchParams.set(key, value);
|
|
14667
|
+
}
|
|
14668
|
+
});
|
|
14669
|
+
searchParams.set("timestamp", String((/* @__PURE__ */ new Date()).getTime()));
|
|
14670
|
+
const newSearch = [...searchParams.entries()].map(([key, value]) => `${key}=${value}`).join("&");
|
|
14671
|
+
return `${url.origin}${url.pathname}?${newSearch}`;
|
|
14672
|
+
}
|
|
14673
|
+
|
|
14659
14674
|
function boundsToArray(bounds) {
|
|
14660
14675
|
const ne = bounds.getNorthEast();
|
|
14661
14676
|
const sw = bounds.getSouthWest();
|
|
@@ -15821,6 +15836,7 @@ var LeafletMapAdapter = (function () {
|
|
|
15821
15836
|
var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15822
15837
|
class ImageLayer extends leafletSrcExports.Layer {
|
|
15823
15838
|
constructor(url, options) {
|
|
15839
|
+
var _a;
|
|
15824
15840
|
super(options);
|
|
15825
15841
|
__publicField$2(this, "defaultWmsParams", {
|
|
15826
15842
|
service: "WMS",
|
|
@@ -15861,7 +15877,11 @@ var LeafletMapAdapter = (function () {
|
|
|
15861
15877
|
}
|
|
15862
15878
|
}
|
|
15863
15879
|
leafletSrcExports.Util.setOptions(this, opts);
|
|
15864
|
-
this.wmsParams = leafletSrcExports.Util.extend(
|
|
15880
|
+
this.wmsParams = leafletSrcExports.Util.extend(
|
|
15881
|
+
{},
|
|
15882
|
+
this.defaultWmsParams,
|
|
15883
|
+
(_a = params == null ? void 0 : params.params) != null ? _a : {}
|
|
15884
|
+
);
|
|
15865
15885
|
}
|
|
15866
15886
|
setParams(params) {
|
|
15867
15887
|
leafletSrcExports.Util.extend(this.wmsParams, params);
|
|
@@ -16050,6 +16070,13 @@ var LeafletMapAdapter = (function () {
|
|
|
16050
16070
|
return this.layer;
|
|
16051
16071
|
}
|
|
16052
16072
|
}
|
|
16073
|
+
updateLayer(options) {
|
|
16074
|
+
if (this.layer) {
|
|
16075
|
+
const params = (options == null ? void 0 : options.params) || {};
|
|
16076
|
+
leafletSrcExports.Util.extend(this.layer.wmsParams, params);
|
|
16077
|
+
this.layer.update();
|
|
16078
|
+
}
|
|
16079
|
+
}
|
|
16053
16080
|
}
|
|
16054
16081
|
__publicField$1(ImageAdapter, "queue", imageQueue);
|
|
16055
16082
|
|
|
@@ -16173,13 +16200,12 @@ var LeafletMapAdapter = (function () {
|
|
|
16173
16200
|
}
|
|
16174
16201
|
}
|
|
16175
16202
|
}
|
|
16176
|
-
updateLayer() {
|
|
16203
|
+
updateLayer(options) {
|
|
16177
16204
|
if (this.layer) {
|
|
16178
16205
|
const currentUrl = this.layer._url;
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
this.layer.setUrl(newUrl);
|
|
16206
|
+
if (options == null ? void 0 : options.params) {
|
|
16207
|
+
this.layer.setUrl(updateUrlParams(currentUrl, options.params));
|
|
16208
|
+
}
|
|
16183
16209
|
this.layer.redraw();
|
|
16184
16210
|
}
|
|
16185
16211
|
}
|