Skip to content

[Bug] fork MapLibre terrain 3D jitter up & down as we pan #2211

Closed
@jawensi

Description

@jawensi

Description

When I install MapLibre fork and load a 3D terrain, there is an effect in the navigation. When you make pan with the mouse there is a change in the zoom level. This doesn't happen when you rotate the view.

React.App.-.Google.Chrome.2023-06-21.13-15-34.mp4

Expected Behavior

The expected behaviour is to keep the zoom level constant, avoiding this effect. When is used a MapBox fork, the jitter effect doesn't happen.

Steps to Reproduce

import maplibregl from "maplibre-gl";
import "maplibre-gl/dist/maplibre-gl.css";
import Map, { Source } from "react-map-gl";

export const MyMap = () => {

  return (
    <div style={{ height: "100%", width: "100%" }}>
      <Map
        id="map"
        initialViewState={{
          longitude: 11,
          latitude: 49,
          zoom: 4,
        }}
        mapLib={maplibregl}
        minZoom={0}
        maxZoom={22}
        mapStyle={
          "https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL"
        }
        terrain={{ exaggeration: 1.3, source: "terrainLayer" }}
      >
        <Source
          id="terrainLayer"
          type="raster-dem"
          tiles={[
            "https://wms.wheregroup.com/dem_tileserver/raster_dem/{z}/{x}/{y}.webp",
          ]}
          tileSize={256}
        />
      </Map>
    </div>
  );
};

Environment

  • Framework version: react-map-gl@7.0.23
  • Map library: maplibre-gl@2.4.0,
  • Browser: Chrome 113.0
  • OS: windows 11

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions