rnmapbox / maps

A Mapbox react native module for creating custom maps
MIT License
2.19k stars 834 forks source link

[Bug]: 3D terrain does not show with Mapbox v11 #3592

Closed GBPeters closed 3 weeks ago

GBPeters commented 3 weeks ago

Mapbox Implementation

Mapbox

Mapbox Version

11.4.0

React Native Version

0.74.5

Platform

iOS

@rnmapbox/maps version

10.1.29

Standalone component to reproduce

import React from 'react';
import { StyleSheet, View } from 'react-native';
import MapboxGL, { Terrain } from '@rnmapbox/maps';

export default function App() {
  return (
    <View style={styles.container}>
      <MapboxGL.MapView style={{ flex: 1 }}>
        <MapboxGL.RasterDemSource
          id="mapbox-dem"
          url="mapbox://mapbox.mapbox-terrain-dem-v1"
        >
          <Terrain style={{exaggeration: 1}}/>
        </MapboxGL.RasterDemSource>
        <MapboxGL.Camera
          zoomLevel={11}
          centerCoordinate={[7.658596832896972, 45.976536103548355]}
          pitch={60}
        />
      </MapboxGL.MapView>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

Observed behavior and steps to reproduce

Component above should pan to the Matterhorn, and show extruded 3D terrain. If I switch to using mapbox v10, it works. In v11, the 3D terrain is not shown. No errors or traces, neither from react / expo nor from native code in Xcode.

Flat Matterhorn

Things I tried:

I have not verified this on Android.

Expected behavior

The maps pans to a beautiful 3D view on the iconic Matterhorn.

Or in boring terms: terrain is shown in 3D, not flat.

Notes / preliminary analysis

I wish I had, but since there's no error emitted I'm at a loss. Of course, I genuinely hope I just made a typo somewhere and this is easy to fix 😄

Additional links and references

Example can be found here: https://github.com/GBPeters/TerrainMWE

I included download and public tokens, I will invalidate these once the issue is closed.

GBPeters commented 3 weeks ago

Oh, only now I find this is a duplicate of https://github.com/rnmapbox/maps/issues/3567