maplibre-gl-components 0.20.3 → 0.20.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/dist/{ControlGrid-BhXCg6_6.js → ControlGrid-DZuo4G2B.js} +37 -33
- package/dist/{ControlGrid-96YvXuIh.cjs → ControlGrid-uSfBqe_5.cjs} +7 -7
- package/dist/{DuckDBConverter-uWVU-eAR.js → DuckDBConverter-B6C0hZof.js} +1 -1
- package/dist/{DuckDBConverter-BfGlAhtm.cjs → DuckDBConverter-BFaMPglx.cjs} +1 -1
- package/dist/{ShapefileConverter-Ch3A6x1f.js → ShapefileConverter-B27S0Yww.js} +1 -1
- package/dist/{ShapefileConverter-BHHDCN1E.cjs → ShapefileConverter-BIT7sJmm.cjs} +1 -1
- package/dist/{geotiff--1panAaD.js → geotiff-CgNQDPkf.js} +2 -2
- package/dist/{geotiff-C2ECK1Ba.cjs → geotiff-DG1Dpz4s.cjs} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{lerc-DAhaV--0.cjs → lerc-BGzVl9ck.cjs} +1 -1
- package/dist/{lerc-BeWDdDnk.js → lerc-Uc8LAlgh.js} +1 -1
- package/dist/{maplibre-geoman.es-Pay8LQVk.cjs → maplibre-geoman.es-D7gaavHL.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/core/ZarrLayer.d.ts +9 -2
- package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -1
- package/dist/types/lib/core/types.d.ts +57 -0
- package/dist/types/lib/core/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3054,7 +3054,7 @@ var mq = {
|
|
|
3054
3054
|
if (t === "shapefile") {
|
|
3055
3055
|
if (!this._shapefileConverter) {
|
|
3056
3056
|
this._updateLoading("Loading Shapefile converter...");
|
|
3057
|
-
const { getShapefileConverter: s } = await import("./ShapefileConverter-
|
|
3057
|
+
const { getShapefileConverter: s } = await import("./ShapefileConverter-B27S0Yww.js").then((a) => a.n);
|
|
3058
3058
|
this._shapefileConverter = s();
|
|
3059
3059
|
}
|
|
3060
3060
|
const r = await this._shapefileConverter.convert(n, e.name, i);
|
|
@@ -3062,9 +3062,9 @@ var mq = {
|
|
|
3062
3062
|
} else if (Fae(t)) {
|
|
3063
3063
|
if (!this._duckdbConverter) {
|
|
3064
3064
|
this._updateLoading("Loading DuckDB converter...");
|
|
3065
|
-
const { getDuckDBConverter: s } = await import("./DuckDBConverter-
|
|
3065
|
+
const { getDuckDBConverter: s } = await import("./DuckDBConverter-B6C0hZof.js").then((a) => a.n);
|
|
3066
3066
|
if (this._duckdbConverter = s(), this._options.duckdbBundleUrl) {
|
|
3067
|
-
const { DuckDBConverter: a } = await import("./DuckDBConverter-
|
|
3067
|
+
const { DuckDBConverter: a } = await import("./DuckDBConverter-B6C0hZof.js").then((l) => l.n);
|
|
3068
3068
|
this._duckdbConverter = new a(this._options.duckdbBundleUrl);
|
|
3069
3069
|
}
|
|
3070
3070
|
}
|
|
@@ -4530,7 +4530,7 @@ var ioe = ["none", "bone", "bwr", "cividis", "cool", "coolwarm", "gray", "hot",
|
|
|
4530
4530
|
if (!(i instanceof Error ? i.message : String(i)).includes("non-unsigned integers not yet supported")) throw i;
|
|
4531
4531
|
const { parseCOGTileMatrixSet: n, texture: r } = await import("@developmentseed/deck.gl-geotiff");
|
|
4532
4532
|
if (typeof n != "function" || typeof r?.inferTextureFormat != "function") throw i;
|
|
4533
|
-
const { fromUrl: s } = await import("./geotiff
|
|
4533
|
+
const { fromUrl: s } = await import("./geotiff-CgNQDPkf.js"), { CreateTexture: a, FilterNoDataVal: l, MaskTexture: h } = await import("@developmentseed/deck.gl-raster/gpu-modules"), d = await import("./lib-CNQtqzfc.js"), p = d.default || d, g = this.props.geotiff, v = typeof g == "string" ? await s(g) : g, y = this.props.geoKeysParser, E = await n(v, y), S = await v.getImage(), R = await v.getImageCount(), I = [];
|
|
4534
4534
|
for (let ae = 0; ae < R; ae++) I.push(await v.getImage(ae));
|
|
4535
4535
|
const k = await y(S.getGeoKeys());
|
|
4536
4536
|
if (!k) throw new Error("Could not determine source projection from GeoTIFF geo keys");
|
|
@@ -6728,8 +6728,8 @@ var Loe = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBo
|
|
|
6728
6728
|
off(e, t) {
|
|
6729
6729
|
this._eventHandlers.get(e)?.delete(t);
|
|
6730
6730
|
}
|
|
6731
|
-
async addLayer(e, t) {
|
|
6732
|
-
e && (this._state.url = e), t && (this._state.variable = t), await this._addLayer();
|
|
6731
|
+
async addLayer(e, t, i) {
|
|
6732
|
+
e && (this._state.url = e), t && (this._state.variable = t), await this._addLayer(i);
|
|
6733
6733
|
}
|
|
6734
6734
|
removeLayer(e) {
|
|
6735
6735
|
this._removeLayer(e), this._render();
|
|
@@ -6996,32 +6996,36 @@ var Loe = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBo
|
|
|
6996
6996
|
const e = document.getElementById("zarr-colormap-preview");
|
|
6997
6997
|
e && (e.style.background = `linear-gradient(to right, ${this._state.colormap.join(", ")})`);
|
|
6998
6998
|
}
|
|
6999
|
-
async _addLayer() {
|
|
7000
|
-
|
|
7001
|
-
|
|
6999
|
+
async _addLayer(e) {
|
|
7000
|
+
const t = !!e?.store;
|
|
7001
|
+
if (!this._map || !t && !this._state.url || !this._state.variable) {
|
|
7002
|
+
this._state.error = t ? "Please enter a variable name." : "Please enter a Zarr URL and variable name.", this._render();
|
|
7002
7003
|
return;
|
|
7003
7004
|
}
|
|
7004
7005
|
this._state.loading = !0, this._state.error = null, this._state.status = null, this._render();
|
|
7005
7006
|
try {
|
|
7006
|
-
const { ZarrLayer:
|
|
7007
|
-
id:
|
|
7008
|
-
source: this._state.url,
|
|
7007
|
+
const { ZarrLayer: i } = await import("@carbonplan/zarr-layer"), n = `zarr-layer-${this._layerCounter++}`, r = e?.selector ?? (this._state.selector && Object.keys(this._state.selector).length > 0 ? this._state.selector : void 0), s = {
|
|
7008
|
+
id: n,
|
|
7009
7009
|
variable: this._state.variable,
|
|
7010
|
-
colormap: this._state.colormap,
|
|
7011
|
-
clim: this._state.clim,
|
|
7012
|
-
opacity: this._state.layerOpacity,
|
|
7013
|
-
selector:
|
|
7014
|
-
}
|
|
7015
|
-
|
|
7016
|
-
const
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7010
|
+
colormap: e?.colormap ?? this._state.colormap,
|
|
7011
|
+
clim: e?.clim ?? this._state.clim,
|
|
7012
|
+
opacity: e?.opacity ?? this._state.layerOpacity,
|
|
7013
|
+
selector: r
|
|
7014
|
+
};
|
|
7015
|
+
this._state.url && (s.source = this._state.url), e?.store && (s.store = e.store), e?.zarrVersion && (s.zarrVersion = e.zarrVersion), e?.transformRequest && (s.transformRequest = e.transformRequest), e?.crs && (s.crs = e.crs), e?.proj4 && (s.proj4 = e.proj4), e?.bounds && (s.bounds = e.bounds), e?.spatialDimensions && (s.spatialDimensions = e.spatialDimensions);
|
|
7016
|
+
const a = { ...s };
|
|
7017
|
+
delete a.store, delete a.transformRequest;
|
|
7018
|
+
const l = this._state.layerName?.trim();
|
|
7019
|
+
l && (a._layerName = l), this._zarrLayerPropsMap.set(n, a);
|
|
7020
|
+
const h = new i(s);
|
|
7021
|
+
this._zarrLayers.set(n, h);
|
|
7022
|
+
let d;
|
|
7023
|
+
this._options.beforeId && (this._map.getLayer(this._options.beforeId) ? d = this._options.beforeId : console.warn(`[ZarrLayerControl] beforeId "${this._options.beforeId}" not found in map layers, adding layer on top`)), d ? this._map.addLayer(h, d) : this._map.addLayer(h), this._state.pickable && this._setupLayerClickHandler(n), this._state.hasLayer = this._zarrLayers.size > 0, this._state.layerCount = this._zarrLayers.size, this._state.layers = this._buildLayerInfoList(), this._state.loading = !1, this._state.status = "Zarr layer added successfully.", this._state.layerName = "", this._render(), this._emit("layeradd", {
|
|
7020
7024
|
url: this._state.url,
|
|
7021
|
-
layerId:
|
|
7025
|
+
layerId: n
|
|
7022
7026
|
});
|
|
7023
|
-
} catch (
|
|
7024
|
-
this._state.loading = !1, this._state.error = `Failed to load Zarr: ${
|
|
7027
|
+
} catch (i) {
|
|
7028
|
+
this._state.loading = !1, this._state.error = `Failed to load Zarr: ${i instanceof Error ? i.message : String(i)}`, this._render(), this._emit("error", { error: this._state.error });
|
|
7025
7029
|
}
|
|
7026
7030
|
}
|
|
7027
7031
|
_setupLayerClickHandler(e) {
|
|
@@ -8222,7 +8226,7 @@ var Goe = [
|
|
|
8222
8226
|
this._state.loading = !0, this._state.error = null, this._state.status = null, this._render();
|
|
8223
8227
|
try {
|
|
8224
8228
|
await this._ensureOverlay();
|
|
8225
|
-
const { COGLayer: l } = await import("@developmentseed/deck.gl-geotiff"), { fromUrl: h } = await import("./geotiff
|
|
8229
|
+
const { COGLayer: l } = await import("@developmentseed/deck.gl-geotiff"), { fromUrl: h } = await import("./geotiff-CgNQDPkf.js");
|
|
8226
8230
|
this._patchCOGLayer(l);
|
|
8227
8231
|
const d = `stac-${this._state.stacItem?.id || "layer"}-rgb-${this._layerCounter++}`, [p, g, v] = await Promise.all([
|
|
8228
8232
|
h(r.href),
|
|
@@ -8390,7 +8394,7 @@ var Goe = [
|
|
|
8390
8394
|
e.prototype._parseGeoTIFF = async function() {
|
|
8391
8395
|
const { parseCOGTileMatrixSet: n, texture: r } = await import("@developmentseed/deck.gl-geotiff");
|
|
8392
8396
|
if (typeof n != "function" || typeof r?.inferTextureFormat != "function") return i.call(this);
|
|
8393
|
-
const { fromUrl: s } = await import("./geotiff
|
|
8397
|
+
const { fromUrl: s } = await import("./geotiff-CgNQDPkf.js"), { CreateTexture: a, FilterNoDataVal: l, Colormap: h } = await import("@developmentseed/deck.gl-raster/gpu-modules"), d = await import("./lib-CNQtqzfc.js"), p = d.default || d, g = this.props.geotiff, v = typeof g == "string" ? await s(g) : g, y = this.props.geoKeysParser;
|
|
8394
8398
|
let E;
|
|
8395
8399
|
try {
|
|
8396
8400
|
E = await n(v, y);
|
|
@@ -10073,7 +10077,7 @@ var a9 = class {
|
|
|
10073
10077
|
throw new Error("CORS error: Unable to fetch the file. The server doesn't allow cross-origin requests.");
|
|
10074
10078
|
}
|
|
10075
10079
|
async _loadGeoParquet(e) {
|
|
10076
|
-
const { getDuckDBConverter: t } = await import("./DuckDBConverter-
|
|
10080
|
+
const { getDuckDBConverter: t } = await import("./DuckDBConverter-B6C0hZof.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
|
|
10077
10081
|
let r;
|
|
10078
10082
|
try {
|
|
10079
10083
|
r = await n.arrayBuffer();
|
|
@@ -10117,7 +10121,7 @@ var a9 = class {
|
|
|
10117
10121
|
}
|
|
10118
10122
|
async _setupViewportLoading(e, t, i) {
|
|
10119
10123
|
if (!this._map) return;
|
|
10120
|
-
const { getDuckDBConverter: n } = await import("./DuckDBConverter-
|
|
10124
|
+
const { getDuckDBConverter: n } = await import("./DuckDBConverter-B6C0hZof.js").then((a) => a.n), r = n(), s = `${e}.parquet`;
|
|
10121
10125
|
try {
|
|
10122
10126
|
await r.registerRemoteParquet(t, s);
|
|
10123
10127
|
const a = await r.getParquetSchema(s);
|
|
@@ -10146,7 +10150,7 @@ var a9 = class {
|
|
|
10146
10150
|
for (const n of t.layerIds) this._map.getLayer(n) && this._map.setLayoutProperty(n, "visibility", "visible");
|
|
10147
10151
|
this._viewportLoadingState.set(e, !0);
|
|
10148
10152
|
try {
|
|
10149
|
-
const { getDuckDBConverter: n } = await import("./DuckDBConverter-
|
|
10153
|
+
const { getDuckDBConverter: n } = await import("./DuckDBConverter-B6C0hZof.js").then((d) => d.n), r = n(), s = this._map.getBounds(), a = [
|
|
10150
10154
|
s.getWest(),
|
|
10151
10155
|
s.getSouth(),
|
|
10152
10156
|
s.getEast(),
|
|
@@ -10161,7 +10165,7 @@ var a9 = class {
|
|
|
10161
10165
|
}
|
|
10162
10166
|
async _cleanupViewportLoading() {
|
|
10163
10167
|
if (this._map && this._viewportHandler && (this._map.off("moveend", this._viewportHandler), this._viewportHandler = void 0), this._viewportLoadingLayers.size > 0) try {
|
|
10164
|
-
const { getDuckDBConverter: e } = await import("./DuckDBConverter-
|
|
10168
|
+
const { getDuckDBConverter: e } = await import("./DuckDBConverter-B6C0hZof.js").then((i) => i.n), t = e();
|
|
10165
10169
|
for (const i of this._viewportLoadingLayers) {
|
|
10166
10170
|
const n = this._vectorLayers.get(i);
|
|
10167
10171
|
n?.duckdbFileName && await t.unregisterFile(n.duckdbFileName);
|
|
@@ -10174,7 +10178,7 @@ var a9 = class {
|
|
|
10174
10178
|
const t = this._vectorLayers.get(e);
|
|
10175
10179
|
if (!(!t?.viewportLoading || !t.duckdbFileName)) {
|
|
10176
10180
|
try {
|
|
10177
|
-
const { getDuckDBConverter: i } = await import("./DuckDBConverter-
|
|
10181
|
+
const { getDuckDBConverter: i } = await import("./DuckDBConverter-B6C0hZof.js").then((n) => n.n);
|
|
10178
10182
|
await i().unregisterFile(t.duckdbFileName);
|
|
10179
10183
|
} catch {
|
|
10180
10184
|
}
|
|
@@ -11048,7 +11052,7 @@ var rle = class {
|
|
|
11048
11052
|
throw new Error("CORS error: Unable to fetch the file. The server doesn't allow cross-origin requests.");
|
|
11049
11053
|
}
|
|
11050
11054
|
async _loadGeoParquet(e) {
|
|
11051
|
-
const { getDuckDBConverter: t } = await import("./DuckDBConverter-
|
|
11055
|
+
const { getDuckDBConverter: t } = await import("./DuckDBConverter-B6C0hZof.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
|
|
11052
11056
|
let r;
|
|
11053
11057
|
try {
|
|
11054
11058
|
r = await n.arrayBuffer();
|