Skip to content

[Bug] TerrainLayer Missing tiles, poor performances, slow re-load. #8976

@ImanEmadi

Description

@ImanEmadi

Description

Hello,

I am using the TerrainLayer with mapbox service APIs to render a 3D map:

const ELEVATION_DECODER = {
    rScaler: 6553.6,
    gScaler: 25.6,
    bScaler: 0.1,
    offset: -10000
};
const terrain_l_props = {
    id: 'terrain',
    minZoom: 0,
    maxZoom: 23,
    elevationDecoder: ELEVATION_DECODER,
    elevationData: TERRAIN_IMAGE,
    texture: SURFACE_IMAGE,
    wireframe: false,
    color: [255, 255, 255],
    opacity: 1,
};

 return   <DeckGL
            key={"DeckGL"}
            parameters={{
                depthTest: true,
            }}
            initialViewState={viewState}
            controller={true}
            views={new MapView({ repeat: true, orthographic: false })}
            {...props}
        >
            <TerrainLayer
                {...terrain_l_props}
            />
            {children}
        </DeckGL>

When i zoom in and then out, many tiles of the map disappear and leave white squares behinds, sometimes they take long to re-render again.
this also happens sometimes when i rotate the camera.
to me, it seems like that the TerrainLayer is clearing some tiles off the map, that it assumes are out of the viewPort, for some reasons.

also i should note that, if i replace this TerrainLayer with react-map-gl's Map component, the 3D map is rendered smoothly, with no problem and missing tiles and loads much faster.

since this significant amount of performance change is obtained just by replacing the TerrainLayer, while not changing anything else, i believe this is a problem with the TerrainLayer that needs to be addressed.

again, the slow performance of the map can not be due to my internet or system, as everything goes very smoothly if i render it with react-map-gl

Screenshot from 2024-06-25 09-11-37

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

I expect the 3D map not to remove the tiles that are still visible to the user, additionally, i expect them to load faster.

Steps to Reproduce

Install deck.gl deps, copy paste the code from me, additionally, make some small visualizations over the map like PathLayers and etc... that's it for me.

Environment

  • Framework version: 9
  • Browser: FireFox and Chrome
  • OS: Linux

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions