@deck.gl/geo-layers 9.0.29 → 9.0.31

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.
@@ -20,9 +20,7 @@ const defaultProps = {
20
20
  pbrMaterial: { type: 'object', value: null },
21
21
  featureIds: { type: 'array', value: null, optional: true }
22
22
  };
23
- export default class MeshLayer extends SimpleMeshLayer {
24
- static { this.layerName = 'MeshLayer'; }
25
- static { this.defaultProps = defaultProps; }
23
+ class MeshLayer extends SimpleMeshLayer {
26
24
  getShaders() {
27
25
  const shaders = super.getShaders();
28
26
  const modules = shaders.modules;
@@ -126,3 +124,6 @@ export default class MeshLayer extends SimpleMeshLayer {
126
124
  this.setState({ parsedPBRMaterial: null });
127
125
  }
128
126
  }
127
+ MeshLayer.layerName = 'MeshLayer';
128
+ MeshLayer.defaultProps = defaultProps;
129
+ export default MeshLayer;
@@ -19,9 +19,7 @@ const defaultProps = {
19
19
  binary: true
20
20
  };
21
21
  /** Render data formatted as [Mapbox Vector Tiles](https://docs.mapbox.com/vector-tiles/specification/). */
22
- export default class MVTLayer extends TileLayer {
23
- static { this.layerName = 'MVTLayer'; }
24
- static { this.defaultProps = defaultProps; }
22
+ class MVTLayer extends TileLayer {
25
23
  initializeState() {
26
24
  super.initializeState();
27
25
  // GlobeView doesn't work well with binary data
@@ -274,6 +272,9 @@ export default class MVTLayer extends TileLayer {
274
272
  });
275
273
  }
276
274
  }
275
+ MVTLayer.layerName = 'MVTLayer';
276
+ MVTLayer.defaultProps = defaultProps;
277
+ export default MVTLayer;
277
278
  function getFeatureUniqueId(feature, uniqueIdProperty) {
278
279
  if (feature.properties && uniqueIdProperty) {
279
280
  return feature.properties[uniqueIdProperty];
@@ -4,9 +4,7 @@ const defaultProps = {
4
4
  getQuadkey: { type: 'accessor', value: (d) => d.quadkey }
5
5
  };
6
6
  /** Render filled and/or stroked polygons based on the [Quadkey](https://towardsdatascience.com/geospatial-indexing-with-quadkeys-d933dff01496) geospatial indexing system. */
7
- export default class QuadkeyLayer extends GeoCellLayer {
8
- static { this.layerName = 'QuadkeyLayer'; }
9
- static { this.defaultProps = defaultProps; }
7
+ class QuadkeyLayer extends GeoCellLayer {
10
8
  indexToBounds() {
11
9
  const { data, extruded, getQuadkey } = this.props;
12
10
  // To avoid z-fighting reduce polygon footprint when extruding
@@ -20,3 +18,6 @@ export default class QuadkeyLayer extends GeoCellLayer {
20
18
  };
21
19
  }
22
20
  }
21
+ QuadkeyLayer.layerName = 'QuadkeyLayer';
22
+ QuadkeyLayer.defaultProps = defaultProps;
23
+ export default QuadkeyLayer;
@@ -23,9 +23,7 @@ const defaultProps = {
23
23
  getS2Token: { type: 'accessor', value: (d) => d.token }
24
24
  };
25
25
  /** Render filled and/or stroked polygons based on the [S2](http://s2geometry.io/) geospatial indexing system. */
26
- export default class S2Layer extends GeoCellLayer {
27
- static { this.layerName = 'S2Layer'; }
28
- static { this.defaultProps = defaultProps; }
26
+ class S2Layer extends GeoCellLayer {
29
27
  indexToBounds() {
30
28
  const { data, getS2Token } = this.props;
31
29
  return {
@@ -36,3 +34,6 @@ export default class S2Layer extends GeoCellLayer {
36
34
  };
37
35
  }
38
36
  }
37
+ S2Layer.layerName = 'S2Layer';
38
+ S2Layer.defaultProps = defaultProps;
39
+ export default S2Layer;
@@ -61,9 +61,7 @@ function urlTemplateToUpdateTrigger(template) {
61
61
  return template || '';
62
62
  }
63
63
  /** Render mesh surfaces from height map images. */
64
- export default class TerrainLayer extends CompositeLayer {
65
- static { this.defaultProps = defaultProps; }
66
- static { this.layerName = 'TerrainLayer'; }
64
+ class TerrainLayer extends CompositeLayer {
67
65
  updateState({ props, oldProps }) {
68
66
  const elevationDataChanged = props.elevationData !== oldProps.elevationData;
69
67
  if (elevationDataChanged) {
@@ -231,3 +229,6 @@ export default class TerrainLayer extends CompositeLayer {
231
229
  });
232
230
  }
233
231
  }
232
+ TerrainLayer.defaultProps = defaultProps;
233
+ TerrainLayer.layerName = 'TerrainLayer';
234
+ export default TerrainLayer;
@@ -20,9 +20,7 @@ const defaultProps = {
20
20
  _getMeshColor: { type: 'function', value: tileHeader => [255, 255, 255] }
21
21
  };
22
22
  /** Render 3d tiles data formatted according to the [3D Tiles Specification](https://www.opengeospatial.org/standards/3DTiles) and [`ESRI I3S`](https://github.com/Esri/i3s-spec) */
23
- export default class Tile3DLayer extends CompositeLayer {
24
- static { this.defaultProps = defaultProps; }
25
- static { this.layerName = 'Tile3DLayer'; }
23
+ class Tile3DLayer extends CompositeLayer {
26
24
  initializeState() {
27
25
  if ('onTileLoadFail' in this.props) {
28
26
  log.removed('onTileLoadFail', 'onTileError')();
@@ -280,6 +278,9 @@ export default class Tile3DLayer extends CompositeLayer {
280
278
  .filter(Boolean);
281
279
  }
282
280
  }
281
+ Tile3DLayer.defaultProps = defaultProps;
282
+ Tile3DLayer.layerName = 'Tile3DLayer';
283
+ export default Tile3DLayer;
283
284
  function getMeshGeometry(contentAttributes) {
284
285
  const attributes = {};
285
286
  attributes.positions = {
@@ -31,9 +31,7 @@ const defaultProps = {
31
31
  *
32
32
  * Instead of fetching the entire dataset, it only loads and renders what's visible in the current viewport.
33
33
  */
34
- export default class TileLayer extends CompositeLayer {
35
- static { this.defaultProps = defaultProps; }
36
- static { this.layerName = 'TileLayer'; }
34
+ class TileLayer extends CompositeLayer {
37
35
  initializeState() {
38
36
  this.state = {
39
37
  tileset: null,
@@ -203,3 +201,6 @@ export default class TileLayer extends CompositeLayer {
203
201
  return this.state.tileset.isTileVisible(tile, cullRect);
204
202
  }
205
203
  }
204
+ TileLayer.defaultProps = defaultProps;
205
+ TileLayer.layerName = 'TileLayer';
206
+ export default TileLayer;
@@ -67,7 +67,7 @@ export class Tileset2D {
67
67
  this.setOptions(this.opts);
68
68
  this.onTileLoad = tile => {
69
69
  this.opts.onTileLoad?.(tile);
70
- if (this.opts.maxCacheByteSize) {
70
+ if (this.opts.maxCacheByteSize != null) {
71
71
  this._cacheByteSize += tile.byteLength;
72
72
  this._resizeCache();
73
73
  }
@@ -325,16 +325,16 @@ export class Tileset2D {
325
325
  /* eslint-disable complexity */
326
326
  _resizeCache() {
327
327
  const { _cache, opts } = this;
328
- const maxCacheSize = opts.maxCacheSize ||
328
+ const maxCacheSize = opts.maxCacheSize ??
329
329
  // @ts-expect-error called only when selectedTiles is initialized
330
- (opts.maxCacheByteSize ? Infinity : DEFAULT_CACHE_SCALE * this.selectedTiles.length);
331
- const maxCacheByteSize = opts.maxCacheByteSize || Infinity;
330
+ (opts.maxCacheByteSize != null ? Infinity : DEFAULT_CACHE_SCALE * this.selectedTiles.length);
331
+ const maxCacheByteSize = opts.maxCacheByteSize ?? Infinity;
332
332
  const overflown = _cache.size > maxCacheSize || this._cacheByteSize > maxCacheByteSize;
333
333
  if (overflown) {
334
334
  for (const [id, tile] of _cache) {
335
335
  if (!tile.isVisible && !tile.isSelected) {
336
336
  // delete tile
337
- this._cacheByteSize -= opts.maxCacheByteSize ? tile.byteLength : 0;
337
+ this._cacheByteSize -= opts.maxCacheByteSize != null ? tile.byteLength : 0;
338
338
  _cache.delete(id);
339
339
  this.opts.onTileUnload?.(tile);
340
340
  }
@@ -25,9 +25,7 @@ const defaultProps = {
25
25
  getTimestamps: { type: 'accessor', value: (d) => d.timestamps }
26
26
  };
27
27
  /** Render animated paths that represent vehicle trips. */
28
- export default class TripsLayer extends PathLayer {
29
- static { this.layerName = 'TripsLayer'; }
30
- static { this.defaultProps = defaultProps; }
28
+ class TripsLayer extends PathLayer {
31
29
  getShaders() {
32
30
  const shaders = super.getShaders();
33
31
  shaders.inject = {
@@ -91,3 +89,6 @@ if(fadeTrail) {
91
89
  super.draw(params);
92
90
  }
93
91
  }
92
+ TripsLayer.layerName = 'TripsLayer';
93
+ TripsLayer.defaultProps = defaultProps;
94
+ export default TripsLayer;
@@ -29,8 +29,6 @@ const defaultProps = {
29
29
  * The layer is used in Hex Tile layer in order to properly discard invisible elements during animation
30
30
  */
31
31
  export class WMSLayer extends CompositeLayer {
32
- static { this.layerName = 'WMSLayer'; }
33
- static { this.defaultProps = defaultProps; }
34
32
  /** Returns true if all async resources are loaded */
35
33
  get isLoaded() {
36
34
  // Track the explicit loading done by this layer
@@ -190,3 +188,5 @@ export class WMSLayer extends CompositeLayer {
190
188
  this.state._timeoutId = setTimeout(() => fn(), ms);
191
189
  }
192
190
  }
191
+ WMSLayer.layerName = 'WMSLayer';
192
+ WMSLayer.defaultProps = defaultProps;