maplibre-gl-raster 0.14.2 → 0.14.4

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.
@@ -4,7 +4,7 @@ import { PathLayer, PolygonLayer, TextLayer } from "@deck.gl/layers";
4
4
  import { CompositeLayer, _GlobeViewport, assert } from "@deck.gl/core";
5
5
  import { SimpleMeshLayer } from "@deck.gl/mesh-layers";
6
6
  import { TileLayer, _Tileset2D } from "@deck.gl/geo-layers";
7
- import maplibregl, { Popup } from "maplibre-gl";
7
+ import { Popup, addProtocol, removeProtocol } from "maplibre-gl";
8
8
  //#region node_modules/@developmentseed/proj/dist/meters-per-unit.js
9
9
  /**
10
10
  * Coefficient to convert the coordinate reference system (CRS)
@@ -19391,7 +19391,7 @@ var CogTilerEngine = class {
19391
19391
  this.clear();
19392
19392
  if (this._protocolRegistered) {
19393
19393
  try {
19394
- maplibregl.removeProtocol(this._protocol);
19394
+ removeProtocol(this._protocol);
19395
19395
  } catch {}
19396
19396
  this._protocolRegistered = false;
19397
19397
  }
@@ -19446,7 +19446,7 @@ var CogTilerEngine = class {
19446
19446
  }
19447
19447
  _ensureProtocol() {
19448
19448
  if (this._protocolRegistered) return;
19449
- maplibregl.addProtocol(this._protocol, (async (params) => ({ data: await this._handleTile(params.url) })));
19449
+ addProtocol(this._protocol, (async (params) => ({ data: await this._handleTile(params.url) })));
19450
19450
  this._protocolRegistered = true;
19451
19451
  }
19452
19452
  /** Protocol handler: parse `<scheme>://<layerId>/<z>/<x>/<y>` and render the
@@ -19537,16 +19537,20 @@ var CogTilerEngine = class {
19537
19537
  const renderKey = JSON.stringify(render);
19538
19538
  const srcId = this._srcId(layer.id);
19539
19539
  const lyrId = this._lyrId(layer.id);
19540
- if (!!!this._map.getSource(srcId)) this._addMapLayer(layer, renderKey);
19541
- else if (this._applied.get(layer.id) !== renderKey) {
19542
- this._removeMapLayer(layer.id);
19543
- this._addMapLayer(layer, renderKey);
19544
- }
19545
- this._registry.set(layer.id, {
19540
+ const exists = !!this._map.getSource(srcId);
19541
+ const registration = {
19546
19542
  source: entry?.source ?? null,
19547
19543
  assets: layer.assets ?? null,
19548
19544
  render
19549
- });
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);
19550
19554
  if (this._map.getLayer(lyrId)) {
19551
19555
  this._map.setPaintProperty(lyrId, "raster-opacity", layer.state.opacity);
19552
19556
  const { minZoom, maxZoom } = resolveZoomRange(layer.state);
@@ -24200,4 +24204,4 @@ var RasterControl = class {
24200
24204
  //#endregion
24201
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 };
24202
24206
 
24203
- //# sourceMappingURL=RasterControl-ACxwy1hW.js.map
24207
+ //# sourceMappingURL=RasterControl-C7Ee7FBU.js.map