You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-reference/geo-layers/terrain-layer.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,10 @@ new deck.TerrainLayer({});
145
145
146
146
## Properties
147
147
148
-
When in Tiled Mode, inherits from all [TileLayer](./tile-layer.md) properties. Forwards `wireframe` property to [SimpleMeshLayer](../mesh-layers/simple-mesh-layer.md).
148
+
When in Tiled Mode, inherits from all [TileLayer](./tile-layer.md) properties. Tiled terrain
149
+
forwards `renderPlaceholder` to its internal `TileLayer`; this can be used to render loading
150
+
footprints before terrain meshes are available. Forwards `wireframe` property to
Copy file name to clipboardExpand all lines: docs/api-reference/geo-layers/tile-layer.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -302,6 +302,10 @@ If not supplied, the `maxCacheByteSize` is set to `Infinity`.
302
302
303
303
How the tile layer refines the visibility of tiles. When zooming in and out, if the layer only shows tiles from the current zoom level, then the user may observe undesirable flashing while new data is loading. By setting `refinementStrategy` the layer can attempt to maintain visual continuity by displaying cached data from a different zoom level before data is available.
304
304
305
+
`refinementStrategy` only reuses loaded tile content that is already in the cache. To render
306
+
synthetic content while a selected tile has no loaded content and no cached ancestor or child is
307
+
visible, use [`renderPlaceholder`](#renderplaceholder).
308
+
305
309
This prop accepts one of the following:
306
310
307
311
*`'best-available'`: If a tile in the current viewport is waiting for its data to load, use cached content from the closest zoom level to fill the empty space. This approach minimizes the visual flashing due to missing content.
@@ -358,6 +362,44 @@ Note that the following sub layer props are overridden by `TileLayer` internally
358
362
-`visible` (toggled based on tile visibility)
359
363
-`highlightedObjectIndex` (set based on the parent layer's highlight state)
Renders one or an array of Layer instances for a selected tile while its data is loading.
368
+
369
+
This prop is disabled by default. When supplied, it is called for selected tiles that have no loaded
370
+
content and no generated sublayers. With the default `refinementStrategy: 'best-available'`, cached
371
+
ancestor or child content still takes priority, so placeholders only fill cold-start or cache-miss
372
+
gaps. With `refinementStrategy: 'no-overlap'`, placeholders are shown instead of cached refinement
373
+
content for selected loading tiles.
374
+
375
+
The callback receives all the `TileLayer` props and the following props:
376
+
377
+
*`id` (string): A unique id for this placeholder sublayer
378
+
*`data` (null): Placeholder tiles do not have loaded tile data
379
+
*`bounds` (number[4]): Bounds of the tile in `[left, bottom, right, top]` order
380
+
*`tile` ([Tile](#tile))
381
+
382
+
- Default: `null`
383
+
384
+
For raster tiles, return a `BitmapLayer` that spans `props.bounds`. Set `pickable: false` if
385
+
placeholder layers should not participate in picking.
386
+
387
+
```ts
388
+
renderPlaceholder: props=> {
389
+
const {data, bounds, ...otherProps} =props;
390
+
391
+
returnnewBitmapLayer(otherProps, {
392
+
image: 'data:image/png;base64,...',
393
+
bounds,
394
+
pickable: false,
395
+
opacity: 0.35
396
+
});
397
+
}
398
+
```
399
+
400
+
Placeholder sublayers do not make the tile or layer loaded. `isLoaded`, `onViewportLoad`, tile cache
401
+
behavior, and tile error handling continue to depend on the real tile request.
402
+
361
403
#### `zRange` (number[2], optional) {#zrange}
362
404
363
405
An array representing the height range of the content in the tiles, as `[minZ, maxZ]`. This is designed to support tiles with 2.5D content, such as buildings or terrains. At high pitch angles, such a tile may "extrude into" the viewport even if its 2D bounding box is out of view. Therefore, it is necessary to provide additional information for the layer to behave correctly. The value of this prop is used for two purposes: 1) to determine the necessary tiles to load and/or render; 2) to determine the possible intersecting tiles during picking.
0 commit comments