maplibre-gl-raster 0.1.2 → 0.1.3

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.
@@ -18816,31 +18816,35 @@ var RasterControl = class {
18816
18816
  const buttonLeft = buttonRect.left - mapRect.left;
18817
18817
  const buttonRight = mapRect.right - buttonRect.right;
18818
18818
  const panelGap = 5;
18819
+ const edgeMargin = 10;
18819
18820
  this._panel.style.top = "";
18820
18821
  this._panel.style.bottom = "";
18821
18822
  this._panel.style.left = "";
18822
18823
  this._panel.style.right = "";
18824
+ const anchorOffset = (position === "top-left" || position === "top-right" ? buttonTop : buttonBottom) + buttonRect.height + panelGap;
18823
18825
  switch (position) {
18824
18826
  case "top-left":
18825
- this._panel.style.top = `${buttonTop + buttonRect.height + panelGap}px`;
18827
+ this._panel.style.top = `${anchorOffset}px`;
18826
18828
  this._panel.style.left = `${buttonLeft}px`;
18827
18829
  break;
18828
18830
  case "top-right":
18829
- this._panel.style.top = `${buttonTop + buttonRect.height + panelGap}px`;
18831
+ this._panel.style.top = `${anchorOffset}px`;
18830
18832
  this._panel.style.right = `${buttonRight}px`;
18831
18833
  break;
18832
18834
  case "bottom-left":
18833
- this._panel.style.bottom = `${buttonBottom + buttonRect.height + panelGap}px`;
18835
+ this._panel.style.bottom = `${anchorOffset}px`;
18834
18836
  this._panel.style.left = `${buttonLeft}px`;
18835
18837
  break;
18836
18838
  case "bottom-right":
18837
- this._panel.style.bottom = `${buttonBottom + buttonRect.height + panelGap}px`;
18839
+ this._panel.style.bottom = `${anchorOffset}px`;
18838
18840
  this._panel.style.right = `${buttonRight}px`;
18839
18841
  break;
18840
18842
  }
18843
+ const available = Math.max(160, mapRect.height - anchorOffset - edgeMargin);
18844
+ this._panel.style.maxHeight = `min(80vh, 720px, ${available}px)`;
18841
18845
  }
18842
18846
  };
18843
18847
  //#endregion
18844
18848
  export { colormaps_default as _, debounce as a, throttle as c, percentileFromHistogram as d, readBandNames as f, COLORMAP_ROW_COUNT as g, COLORMAP_OPTIONS as h, classNames as i, MAX_SAMPLE_TILES as l, COLORMAP_NAMES as m, PALETTE_COLORMAP as n, formatNumericValue as o, loadGeoTIFF as p, clamp as r, generateId as s, RasterControl as t, computeAutoStats as u };
18845
18849
 
18846
- //# sourceMappingURL=RasterControl-C8Znszmf.js.map
18850
+ //# sourceMappingURL=RasterControl-D2NAn2EJ.js.map