maplibre-gl-raster 0.14.0 → 0.14.1

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.
@@ -19342,11 +19342,10 @@ var CogTilerEngine = class {
19342
19342
  _applied = /* @__PURE__ */ new Map();
19343
19343
  /** Monotonic tile-URL version per layer, bumped to refetch on settings edits. */
19344
19344
  _versions = /* @__PURE__ */ new Map();
19345
- _onStyleLoad = null;
19345
+ _onStyleData = null;
19346
19346
  /** Latches true once the style has loaded. After that, `isStyleLoaded()` may
19347
- * dip false again while sources load - which must NOT re-gate later syncs
19348
- * (the one-shot 'load' event never fires twice), or stats-driven re-renders
19349
- * would be lost. */
19347
+ * dip false again while sources load - which must NOT re-gate later syncs, or
19348
+ * stats-driven re-renders would be lost. */
19350
19349
  _styleReady = false;
19351
19350
  constructor(map, deps) {
19352
19351
  this._map = map;
@@ -19385,9 +19384,9 @@ var CogTilerEngine = class {
19385
19384
  /** Tears the engine down: removes its layers, the protocol, and all caches. */
19386
19385
  destroy() {
19387
19386
  this._destroyed = true;
19388
- if (this._onStyleLoad) {
19389
- this._map.off("load", this._onStyleLoad);
19390
- this._onStyleLoad = null;
19387
+ if (this._onStyleData) {
19388
+ this._map.off("styledata", this._onStyleData);
19389
+ this._onStyleData = null;
19391
19390
  }
19392
19391
  this.clear();
19393
19392
  if (this._protocolRegistered) {
@@ -19406,13 +19405,15 @@ var CogTilerEngine = class {
19406
19405
  if (this._destroyed) return;
19407
19406
  if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19408
19407
  else {
19409
- if (!this._onStyleLoad) {
19410
- this._onStyleLoad = () => {
19411
- this._onStyleLoad = null;
19408
+ if (!this._onStyleData) {
19409
+ this._onStyleData = () => {
19410
+ if (this._destroyed || !this._map.isStyleLoaded()) return;
19411
+ this._map.off("styledata", this._onStyleData);
19412
+ this._onStyleData = null;
19412
19413
  this._styleReady = true;
19413
19414
  this._apply();
19414
19415
  };
19415
- this._map.once("load", this._onStyleLoad);
19416
+ this._map.on("styledata", this._onStyleData);
19416
19417
  }
19417
19418
  return;
19418
19419
  }
@@ -19728,7 +19729,7 @@ var TiTilerEngine = class {
19728
19729
  _pending = /* @__PURE__ */ new Map();
19729
19730
  /** Layers whose bounds were already reported (report once per source url). */
19730
19731
  _boundsKey = /* @__PURE__ */ new Map();
19731
- _onStyleLoad = null;
19732
+ _onStyleData = null;
19732
19733
  /** Latches true once the style has loaded; see CogTilerEngine for the
19733
19734
  * rationale (isStyleLoaded may dip false again while sources load). */
19734
19735
  _styleReady = false;
@@ -19765,9 +19766,9 @@ var TiTilerEngine = class {
19765
19766
  /** Tears the engine down: removes its layers and all caches. */
19766
19767
  destroy() {
19767
19768
  this._destroyed = true;
19768
- if (this._onStyleLoad) {
19769
- this._map.off("load", this._onStyleLoad);
19770
- this._onStyleLoad = null;
19769
+ if (this._onStyleData) {
19770
+ this._map.off("styledata", this._onStyleData);
19771
+ this._onStyleData = null;
19771
19772
  }
19772
19773
  if (this._onMapError) {
19773
19774
  this._map.off?.("error", this._onMapError);
@@ -19797,13 +19798,15 @@ var TiTilerEngine = class {
19797
19798
  if (this._destroyed) return;
19798
19799
  if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19799
19800
  else {
19800
- if (!this._onStyleLoad) {
19801
- this._onStyleLoad = () => {
19802
- this._onStyleLoad = null;
19801
+ if (!this._onStyleData) {
19802
+ this._onStyleData = () => {
19803
+ if (this._destroyed || !this._map.isStyleLoaded()) return;
19804
+ this._map.off("styledata", this._onStyleData);
19805
+ this._onStyleData = null;
19803
19806
  this._styleReady = true;
19804
19807
  this._apply();
19805
19808
  };
19806
- this._map.once("load", this._onStyleLoad);
19809
+ this._map.on("styledata", this._onStyleData);
19807
19810
  }
19808
19811
  return;
19809
19812
  }
@@ -20454,7 +20457,7 @@ var LayerManager = class {
20454
20457
  _crsFailed = /* @__PURE__ */ new Set();
20455
20458
  _attributions = new globalThis.Map();
20456
20459
  _attribStyleReady = false;
20457
- _onAttribStyleLoad = null;
20460
+ _onAttribStyleData = null;
20458
20461
  _destroyed = false;
20459
20462
  _onZoom = null;
20460
20463
  _zoomVisibleSig = "";
@@ -20961,9 +20964,9 @@ var LayerManager = class {
20961
20964
  this._layers = [];
20962
20965
  this._selectedId = null;
20963
20966
  for (const id of [...this._attributions.keys()]) this._removeAttribution(id);
20964
- if (this._onAttribStyleLoad) {
20965
- this._map.off("load", this._onAttribStyleLoad);
20966
- this._onAttribStyleLoad = null;
20967
+ if (this._onAttribStyleData) {
20968
+ this._map.off("styledata", this._onAttribStyleData);
20969
+ this._onAttribStyleData = null;
20967
20970
  }
20968
20971
  if (this._onZoom) {
20969
20972
  this._map.off("zoom", this._onZoom);
@@ -21217,13 +21220,15 @@ var LayerManager = class {
21217
21220
  _syncAttributions() {
21218
21221
  if (!this._attribStyleReady) if (this._map.isStyleLoaded()) this._attribStyleReady = true;
21219
21222
  else {
21220
- if (!this._onAttribStyleLoad) {
21221
- this._onAttribStyleLoad = () => {
21222
- this._onAttribStyleLoad = null;
21223
+ if (!this._onAttribStyleData) {
21224
+ this._onAttribStyleData = () => {
21225
+ if (!this._map.isStyleLoaded()) return;
21226
+ this._map.off("styledata", this._onAttribStyleData);
21227
+ this._onAttribStyleData = null;
21223
21228
  this._attribStyleReady = true;
21224
21229
  this._syncAttributions();
21225
21230
  };
21226
- this._map.once("load", this._onAttribStyleLoad);
21231
+ this._map.on("styledata", this._onAttribStyleData);
21227
21232
  }
21228
21233
  return;
21229
21234
  }
@@ -24199,4 +24204,4 @@ var RasterControl = class {
24199
24204
  //#endregion
24200
24205
  export { DEFAULT_TITILER_ENDPOINT as A, COLORMAP_ROW_COUNT as B, throttle as C, loadVrt as D, isVrtUrl as E, loadColormapSprite as F, statsForBand as G, colormaps_default as H, sampleColormapStops as I, mergeAutoStats as J, MAX_SAMPLE_TILES as K, COLORMAP_DISPLAY_NAMES as L, isMosaicJsonUrl as M, PALETTE_COLORMAP as N, parseVrt as O, isKnownColormap as P, createResilientEpsgResolver as Q, COLORMAP_NAMES as R, generateId as S, isVrtFile as T, DEFAULT_INDEX_RANGE as U, colormapDisplayName as V, autoRangeFor as W, percentileFromHistogram as X, mergeBandStats as Y, readBandNames as Z, parseMosaic as _, NORMALIZED_DIFFERENCE_INDICES as a, debounce as b, readPixelValues as c, MAX_MOSAIC_ASSETS as d, MosaicUnsupportedError as f, mosaicMinZoom as g, mosaicInitialView as h, CUSTOM_NORMALIZED_DIFFERENCE as i, TITILER_TMS as j, loadGeoTIFF as k, DEFAULT_ENGINE as l, loadMosaic as m, Colorbar as n, guessBandForRole as o, assetUrlToHttps as p, computeAutoStats as q, CUSTOM_INDEX_ID as r, indexById as s, RasterControl as t, LayerManager as u, clamp as v, VrtUnsupportedError as w, formatNumericValue as x, classNames as y, COLORMAP_OPTIONS as z };
24201
24206
 
24202
- //# sourceMappingURL=RasterControl-hvApJoZQ.js.map
24207
+ //# sourceMappingURL=RasterControl-DZyNgBTd.js.map