maplibre-gl-raster 0.14.0 → 0.14.2

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) {
@@ -19404,18 +19403,16 @@ var CogTilerEngine = class {
19404
19403
  * loaded and the wasm module is ready. */
19405
19404
  _apply() {
19406
19405
  if (this._destroyed) return;
19407
- if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19408
- else {
19409
- if (!this._onStyleLoad) {
19410
- this._onStyleLoad = () => {
19411
- this._onStyleLoad = null;
19412
- this._styleReady = true;
19413
- this._apply();
19414
- };
19415
- this._map.once("load", this._onStyleLoad);
19416
- }
19417
- return;
19406
+ if (!this._onStyleData) {
19407
+ this._onStyleData = () => {
19408
+ if (this._destroyed || !this._map.isStyleLoaded()) return;
19409
+ this._styleReady = true;
19410
+ this._apply();
19411
+ };
19412
+ this._map.on("styledata", this._onStyleData);
19418
19413
  }
19414
+ if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19415
+ else return;
19419
19416
  const mod = this._ensureModule();
19420
19417
  if (!mod) return;
19421
19418
  this._ensureProtocol();
@@ -19728,7 +19725,7 @@ var TiTilerEngine = class {
19728
19725
  _pending = /* @__PURE__ */ new Map();
19729
19726
  /** Layers whose bounds were already reported (report once per source url). */
19730
19727
  _boundsKey = /* @__PURE__ */ new Map();
19731
- _onStyleLoad = null;
19728
+ _onStyleData = null;
19732
19729
  /** Latches true once the style has loaded; see CogTilerEngine for the
19733
19730
  * rationale (isStyleLoaded may dip false again while sources load). */
19734
19731
  _styleReady = false;
@@ -19765,9 +19762,9 @@ var TiTilerEngine = class {
19765
19762
  /** Tears the engine down: removes its layers and all caches. */
19766
19763
  destroy() {
19767
19764
  this._destroyed = true;
19768
- if (this._onStyleLoad) {
19769
- this._map.off("load", this._onStyleLoad);
19770
- this._onStyleLoad = null;
19765
+ if (this._onStyleData) {
19766
+ this._map.off("styledata", this._onStyleData);
19767
+ this._onStyleData = null;
19771
19768
  }
19772
19769
  if (this._onMapError) {
19773
19770
  this._map.off?.("error", this._onMapError);
@@ -19797,13 +19794,15 @@ var TiTilerEngine = class {
19797
19794
  if (this._destroyed) return;
19798
19795
  if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19799
19796
  else {
19800
- if (!this._onStyleLoad) {
19801
- this._onStyleLoad = () => {
19802
- this._onStyleLoad = null;
19797
+ if (!this._onStyleData) {
19798
+ this._onStyleData = () => {
19799
+ if (this._destroyed || !this._map.isStyleLoaded()) return;
19800
+ this._map.off("styledata", this._onStyleData);
19801
+ this._onStyleData = null;
19803
19802
  this._styleReady = true;
19804
19803
  this._apply();
19805
19804
  };
19806
- this._map.once("load", this._onStyleLoad);
19805
+ this._map.on("styledata", this._onStyleData);
19807
19806
  }
19808
19807
  return;
19809
19808
  }
@@ -20454,7 +20453,7 @@ var LayerManager = class {
20454
20453
  _crsFailed = /* @__PURE__ */ new Set();
20455
20454
  _attributions = new globalThis.Map();
20456
20455
  _attribStyleReady = false;
20457
- _onAttribStyleLoad = null;
20456
+ _onAttribStyleData = null;
20458
20457
  _destroyed = false;
20459
20458
  _onZoom = null;
20460
20459
  _zoomVisibleSig = "";
@@ -20961,9 +20960,9 @@ var LayerManager = class {
20961
20960
  this._layers = [];
20962
20961
  this._selectedId = null;
20963
20962
  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;
20963
+ if (this._onAttribStyleData) {
20964
+ this._map.off("styledata", this._onAttribStyleData);
20965
+ this._onAttribStyleData = null;
20967
20966
  }
20968
20967
  if (this._onZoom) {
20969
20968
  this._map.off("zoom", this._onZoom);
@@ -21217,13 +21216,15 @@ var LayerManager = class {
21217
21216
  _syncAttributions() {
21218
21217
  if (!this._attribStyleReady) if (this._map.isStyleLoaded()) this._attribStyleReady = true;
21219
21218
  else {
21220
- if (!this._onAttribStyleLoad) {
21221
- this._onAttribStyleLoad = () => {
21222
- this._onAttribStyleLoad = null;
21219
+ if (!this._onAttribStyleData) {
21220
+ this._onAttribStyleData = () => {
21221
+ if (!this._map.isStyleLoaded()) return;
21222
+ this._map.off("styledata", this._onAttribStyleData);
21223
+ this._onAttribStyleData = null;
21223
21224
  this._attribStyleReady = true;
21224
21225
  this._syncAttributions();
21225
21226
  };
21226
- this._map.once("load", this._onAttribStyleLoad);
21227
+ this._map.on("styledata", this._onAttribStyleData);
21227
21228
  }
21228
21229
  return;
21229
21230
  }
@@ -24199,4 +24200,4 @@ var RasterControl = class {
24199
24200
  //#endregion
24200
24201
  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
24202
 
24202
- //# sourceMappingURL=RasterControl-hvApJoZQ.js.map
24203
+ //# sourceMappingURL=RasterControl-ACxwy1hW.js.map