maplibre-gl-raster 0.14.1 → 0.14.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.
@@ -19403,20 +19403,16 @@ var CogTilerEngine = class {
19403
19403
  * loaded and the wasm module is ready. */
19404
19404
  _apply() {
19405
19405
  if (this._destroyed) return;
19406
- if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19407
- else {
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;
19413
- this._styleReady = true;
19414
- this._apply();
19415
- };
19416
- this._map.on("styledata", this._onStyleData);
19417
- }
19418
- 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);
19419
19413
  }
19414
+ if (!this._styleReady) if (this._map.isStyleLoaded()) this._styleReady = true;
19415
+ else return;
19420
19416
  const mod = this._ensureModule();
19421
19417
  if (!mod) return;
19422
19418
  this._ensureProtocol();
@@ -19541,16 +19537,20 @@ var CogTilerEngine = class {
19541
19537
  const renderKey = JSON.stringify(render);
19542
19538
  const srcId = this._srcId(layer.id);
19543
19539
  const lyrId = this._lyrId(layer.id);
19544
- if (!!!this._map.getSource(srcId)) this._addMapLayer(layer, renderKey);
19545
- else if (this._applied.get(layer.id) !== renderKey) {
19546
- this._removeMapLayer(layer.id);
19547
- this._addMapLayer(layer, renderKey);
19548
- }
19549
- this._registry.set(layer.id, {
19540
+ const exists = !!this._map.getSource(srcId);
19541
+ const registration = {
19550
19542
  source: entry?.source ?? null,
19551
19543
  assets: layer.assets ?? null,
19552
19544
  render
19553
- });
19545
+ };
19546
+ if (!exists) {
19547
+ this._registry.set(layer.id, registration);
19548
+ this._addMapLayer(layer, renderKey);
19549
+ } else if (this._applied.get(layer.id) !== renderKey) {
19550
+ this._removeMapLayer(layer.id);
19551
+ this._registry.set(layer.id, registration);
19552
+ this._addMapLayer(layer, renderKey);
19553
+ } else this._registry.set(layer.id, registration);
19554
19554
  if (this._map.getLayer(lyrId)) {
19555
19555
  this._map.setPaintProperty(lyrId, "raster-opacity", layer.state.opacity);
19556
19556
  const { minZoom, maxZoom } = resolveZoomRange(layer.state);
@@ -24204,4 +24204,4 @@ var RasterControl = class {
24204
24204
  //#endregion
24205
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 };
24206
24206
 
24207
- //# sourceMappingURL=RasterControl-DZyNgBTd.js.map
24207
+ //# sourceMappingURL=RasterControl-Bem7j-bZ.js.map