Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GBPeters opened this issue Aug 22, 2024 · 1 comment
Closed

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

GBPeters opened this issue Aug 22, 2024 · 1 comment
Labels
bug 🪲 Something isn't working

Comments

@GBPeters
Copy link

GBPeters commented Aug 22, 2024

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:

  • Using 'import Mapbox' instead of 'import MapboxGL'
  • Using direct component imports
  • Explicitly setting the source id for the terrain
  • Adding and removing sky layers according to the example (the sky layer works, but doesn't affect terrain)

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
Copy link
Author

Oh, only now I find this is a duplicate of #3567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant