maplibre-gl-components 0.20.5 → 0.20.6

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.
@@ -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-CWtJ9IOJ.js").then((a) => a.n);
3057
+ const { getShapefileConverter: s } = await import("./ShapefileConverter-BefhyBOj.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-BiaCHtYV.js").then((a) => a.n);
3065
+ const { getDuckDBConverter: s } = await import("./DuckDBConverter-G6cWy2IS.js").then((a) => a.n);
3066
3066
  if (this._duckdbConverter = s(), this._options.duckdbBundleUrl) {
3067
- const { DuckDBConverter: a } = await import("./DuckDBConverter-BiaCHtYV.js").then((l) => l.n);
3067
+ const { DuckDBConverter: a } = await import("./DuckDBConverter-G6cWy2IS.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-D9_iwF_H.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 = [];
4533
+ const { fromUrl: s } = await import("./geotiff-BsSRJ-4E.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");
@@ -8226,7 +8226,7 @@ var Goe = [
8226
8226
  this._state.loading = !0, this._state.error = null, this._state.status = null, this._render();
8227
8227
  try {
8228
8228
  await this._ensureOverlay();
8229
- const { COGLayer: l } = await import("@developmentseed/deck.gl-geotiff"), { fromUrl: h } = await import("./geotiff-D9_iwF_H.js");
8229
+ const { COGLayer: l } = await import("@developmentseed/deck.gl-geotiff"), { fromUrl: h } = await import("./geotiff-BsSRJ-4E.js");
8230
8230
  this._patchCOGLayer(l);
8231
8231
  const d = `stac-${this._state.stacItem?.id || "layer"}-rgb-${this._layerCounter++}`, [p, g, v] = await Promise.all([
8232
8232
  h(r.href),
@@ -8394,7 +8394,7 @@ var Goe = [
8394
8394
  e.prototype._parseGeoTIFF = async function() {
8395
8395
  const { parseCOGTileMatrixSet: n, texture: r } = await import("@developmentseed/deck.gl-geotiff");
8396
8396
  if (typeof n != "function" || typeof r?.inferTextureFormat != "function") return i.call(this);
8397
- const { fromUrl: s } = await import("./geotiff-D9_iwF_H.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;
8397
+ const { fromUrl: s } = await import("./geotiff-BsSRJ-4E.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;
8398
8398
  let E;
8399
8399
  try {
8400
8400
  E = await n(v, y);
@@ -10077,7 +10077,7 @@ var a9 = class {
10077
10077
  throw new Error("CORS error: Unable to fetch the file. The server doesn't allow cross-origin requests.");
10078
10078
  }
10079
10079
  async _loadGeoParquet(e) {
10080
- const { getDuckDBConverter: t } = await import("./DuckDBConverter-BiaCHtYV.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
10080
+ const { getDuckDBConverter: t } = await import("./DuckDBConverter-G6cWy2IS.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
10081
10081
  let r;
10082
10082
  try {
10083
10083
  r = await n.arrayBuffer();
@@ -10121,7 +10121,7 @@ var a9 = class {
10121
10121
  }
10122
10122
  async _setupViewportLoading(e, t, i) {
10123
10123
  if (!this._map) return;
10124
- const { getDuckDBConverter: n } = await import("./DuckDBConverter-BiaCHtYV.js").then((a) => a.n), r = n(), s = `${e}.parquet`;
10124
+ const { getDuckDBConverter: n } = await import("./DuckDBConverter-G6cWy2IS.js").then((a) => a.n), r = n(), s = `${e}.parquet`;
10125
10125
  try {
10126
10126
  await r.registerRemoteParquet(t, s);
10127
10127
  const a = await r.getParquetSchema(s);
@@ -10150,7 +10150,7 @@ var a9 = class {
10150
10150
  for (const n of t.layerIds) this._map.getLayer(n) && this._map.setLayoutProperty(n, "visibility", "visible");
10151
10151
  this._viewportLoadingState.set(e, !0);
10152
10152
  try {
10153
- const { getDuckDBConverter: n } = await import("./DuckDBConverter-BiaCHtYV.js").then((d) => d.n), r = n(), s = this._map.getBounds(), a = [
10153
+ const { getDuckDBConverter: n } = await import("./DuckDBConverter-G6cWy2IS.js").then((d) => d.n), r = n(), s = this._map.getBounds(), a = [
10154
10154
  s.getWest(),
10155
10155
  s.getSouth(),
10156
10156
  s.getEast(),
@@ -10165,7 +10165,7 @@ var a9 = class {
10165
10165
  }
10166
10166
  async _cleanupViewportLoading() {
10167
10167
  if (this._map && this._viewportHandler && (this._map.off("moveend", this._viewportHandler), this._viewportHandler = void 0), this._viewportLoadingLayers.size > 0) try {
10168
- const { getDuckDBConverter: e } = await import("./DuckDBConverter-BiaCHtYV.js").then((i) => i.n), t = e();
10168
+ const { getDuckDBConverter: e } = await import("./DuckDBConverter-G6cWy2IS.js").then((i) => i.n), t = e();
10169
10169
  for (const i of this._viewportLoadingLayers) {
10170
10170
  const n = this._vectorLayers.get(i);
10171
10171
  n?.duckdbFileName && await t.unregisterFile(n.duckdbFileName);
@@ -10178,7 +10178,7 @@ var a9 = class {
10178
10178
  const t = this._vectorLayers.get(e);
10179
10179
  if (!(!t?.viewportLoading || !t.duckdbFileName)) {
10180
10180
  try {
10181
- const { getDuckDBConverter: i } = await import("./DuckDBConverter-BiaCHtYV.js").then((n) => n.n);
10181
+ const { getDuckDBConverter: i } = await import("./DuckDBConverter-G6cWy2IS.js").then((n) => n.n);
10182
10182
  await i().unregisterFile(t.duckdbFileName);
10183
10183
  } catch {
10184
10184
  }
@@ -11052,7 +11052,7 @@ var rle = class {
11052
11052
  throw new Error("CORS error: Unable to fetch the file. The server doesn't allow cross-origin requests.");
11053
11053
  }
11054
11054
  async _loadGeoParquet(e) {
11055
- const { getDuckDBConverter: t } = await import("./DuckDBConverter-BiaCHtYV.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
11055
+ const { getDuckDBConverter: t } = await import("./DuckDBConverter-G6cWy2IS.js").then((a) => a.n), i = t(), n = await this._fetchWithCorsProxy(e);
11056
11056
  let r;
11057
11057
  try {
11058
11058
  r = await n.arrayBuffer();
@@ -11162,7 +11162,7 @@ var rle = class {
11162
11162
  visible: !0,
11163
11163
  collapsed: !0,
11164
11164
  panelWidth: 280,
11165
- maxHeight: 500,
11165
+ maxHeight: 0,
11166
11166
  backgroundColor: "rgba(255, 255, 255, 0.95)",
11167
11167
  borderRadius: 4,
11168
11168
  opacity: 1,
@@ -11179,6 +11179,7 @@ var rle = class {
11179
11179
  _eventHandlers = /* @__PURE__ */ new Map();
11180
11180
  _map;
11181
11181
  _handleZoom;
11182
+ _handleResize;
11182
11183
  _zoomVisible = !0;
11183
11184
  _colorbar;
11184
11185
  _colorbars = [];
@@ -11225,7 +11226,7 @@ var rle = class {
11225
11226
  return this._map = e, this._container = this._createContainer(), this._setupZoomHandler(), this._state.collapsed || this._showPanel(), this._container;
11226
11227
  }
11227
11228
  onRemove() {
11228
- this._handleZoom && this._map && this._map.off("zoom", this._handleZoom), this._removeAllColorbars(), this._container?.remove(), this._container = void 0, this._map = void 0;
11229
+ this._handleZoom && this._map && this._map.off("zoom", this._handleZoom), this._handleResize && (window.removeEventListener("resize", this._handleResize), this._handleResize = void 0), this._removeAllColorbars(), this._container?.remove(), this._container = void 0, this._map = void 0;
11229
11230
  }
11230
11231
  getDefaultPosition() {
11231
11232
  return this._options.position;
@@ -11300,7 +11301,7 @@ var rle = class {
11300
11301
  }
11301
11302
  _createPanel() {
11302
11303
  const e = document.createElement("div");
11303
- e.className = `colorbar-gui-panel ${this._options.position.includes("left") ? "right" : "left"}`, e.style.width = `${this._options.panelWidth}px`, this._options.maxHeight > 0 && (e.style.maxHeight = `${this._options.maxHeight}px`, e.style.overflowY = "auto"), e.style.background = this._options.backgroundColor, e.style.borderRadius = `${this._options.borderRadius}px`, e.style.fontSize = `${this._options.fontSize}px`, e.style.color = this._options.fontColor;
11304
+ e.className = `colorbar-gui-panel ${this._options.position.includes("left") ? "right" : "left"}`, e.style.width = `${this._options.panelWidth}px`, e.style.overflowY = "auto", e.style.background = this._options.backgroundColor, e.style.borderRadius = `${this._options.borderRadius}px`, e.style.fontSize = `${this._options.fontSize}px`, e.style.color = this._options.fontColor;
11304
11305
  const t = document.createElement("div");
11305
11306
  t.className = "colorbar-gui-header", t.innerHTML = `
11306
11307
  <span>Colorbar</span>
@@ -11503,10 +11504,15 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11503
11504
  this._state.collapsed ? this.expand() : this.collapse();
11504
11505
  }
11505
11506
  _showPanel() {
11506
- !this._panel && this._container && (this._panel = this._createPanel(), this._container.appendChild(this._panel)), this._button?.classList.add("active");
11507
+ !this._panel && this._container && (this._panel = this._createPanel(), this._container.appendChild(this._panel)), this._button?.classList.add("active"), this._updatePanelHeight(), this._handleResize || (this._handleResize = () => this._updatePanelHeight(), window.addEventListener("resize", this._handleResize));
11507
11508
  }
11508
11509
  _hidePanel() {
11509
- this._panel?.remove(), this._panel = void 0, this._button?.classList.remove("active");
11510
+ this._handleResize && (window.removeEventListener("resize", this._handleResize), this._handleResize = void 0), this._panel?.remove(), this._panel = void 0, this._button?.classList.remove("active");
11511
+ }
11512
+ _updatePanelHeight() {
11513
+ if (!this._panel) return;
11514
+ const e = 16, t = 200, i = this._panel.getBoundingClientRect().top, n = Math.max(t, window.innerHeight - i - e), r = this._options.maxHeight > 0 ? Math.min(this._options.maxHeight, n) : n;
11515
+ this._panel.style.maxHeight = `${r}px`;
11510
11516
  }
11511
11517
  _setupZoomHandler() {
11512
11518
  this._map && (this._handleZoom = () => {
@@ -11523,7 +11529,7 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11523
11529
  visible: !0,
11524
11530
  collapsed: !0,
11525
11531
  panelWidth: 280,
11526
- maxHeight: 500,
11532
+ maxHeight: 0,
11527
11533
  backgroundColor: "rgba(255, 255, 255, 0.95)",
11528
11534
  borderRadius: 4,
11529
11535
  opacity: 1,
@@ -11540,6 +11546,7 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11540
11546
  _eventHandlers = /* @__PURE__ */ new Map();
11541
11547
  _map;
11542
11548
  _handleZoom;
11549
+ _handleResize;
11543
11550
  _zoomVisible = !0;
11544
11551
  _legend;
11545
11552
  _legends = [];
@@ -11588,7 +11595,7 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11588
11595
  return this._map = e, this._container = this._createContainer(), this._setupZoomHandler(), this._state.collapsed || this._showPanel(), this._container;
11589
11596
  }
11590
11597
  onRemove() {
11591
- this._handleZoom && this._map && this._map.off("zoom", this._handleZoom), this._removeAllLegends(), this._container?.remove(), this._container = void 0, this._map = void 0;
11598
+ this._handleZoom && this._map && this._map.off("zoom", this._handleZoom), this._handleResize && (window.removeEventListener("resize", this._handleResize), this._handleResize = void 0), this._removeAllLegends(), this._container?.remove(), this._container = void 0, this._map = void 0;
11592
11599
  }
11593
11600
  getDefaultPosition() {
11594
11601
  return this._options.position;
@@ -11671,7 +11678,7 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11671
11678
  }
11672
11679
  _createPanel() {
11673
11680
  const e = document.createElement("div");
11674
- e.className = `legend-gui-panel ${this._options.position.includes("left") ? "right" : "left"}`, e.style.minWidth = `${this._options.panelWidth}px`, e.style.width = "auto", e.style.maxWidth = "400px", this._options.maxHeight > 0 && (e.style.maxHeight = `${this._options.maxHeight}px`, e.style.overflowY = "auto"), e.style.background = this._options.backgroundColor, e.style.borderRadius = `${this._options.borderRadius}px`, e.style.fontSize = `${this._options.fontSize}px`, e.style.color = this._options.fontColor;
11681
+ e.className = `legend-gui-panel ${this._options.position.includes("left") ? "right" : "left"}`, e.style.minWidth = `${this._options.panelWidth}px`, e.style.width = "auto", e.style.maxWidth = "400px", e.style.overflowY = "auto", e.style.background = this._options.backgroundColor, e.style.borderRadius = `${this._options.borderRadius}px`, e.style.fontSize = `${this._options.fontSize}px`, e.style.color = this._options.fontColor;
11675
11682
  const t = document.createElement("div");
11676
11683
  t.className = "legend-gui-header", t.innerHTML = `
11677
11684
  <span>Legend</span>
@@ -11882,10 +11889,15 @@ or #440154, #21918c, #fde725`, this._customColorsTextarea.addEventListener("inpu
11882
11889
  this._state.collapsed ? this.expand() : this.collapse();
11883
11890
  }
11884
11891
  _showPanel() {
11885
- !this._panel && this._container && (this._panel = this._createPanel(), this._container.appendChild(this._panel)), this._button?.classList.add("active");
11892
+ !this._panel && this._container && (this._panel = this._createPanel(), this._container.appendChild(this._panel)), this._button?.classList.add("active"), this._updatePanelHeight(), this._handleResize || (this._handleResize = () => this._updatePanelHeight(), window.addEventListener("resize", this._handleResize));
11886
11893
  }
11887
11894
  _hidePanel() {
11888
- this._panel?.remove(), this._panel = void 0, this._button?.classList.remove("active");
11895
+ this._handleResize && (window.removeEventListener("resize", this._handleResize), this._handleResize = void 0), this._panel?.remove(), this._panel = void 0, this._button?.classList.remove("active");
11896
+ }
11897
+ _updatePanelHeight() {
11898
+ if (!this._panel) return;
11899
+ const e = 16, t = 200, i = this._panel.getBoundingClientRect().top, n = Math.max(t, window.innerHeight - i - e), r = this._options.maxHeight > 0 ? Math.min(this._options.maxHeight, n) : n;
11900
+ this._panel.style.maxHeight = `${r}px`;
11889
11901
  }
11890
11902
  _setupZoomHandler() {
11891
11903
  this._map && (this._handleZoom = () => {