How does one set the initial pitch using Mapbox gl?

431 Views Asked by At

I am using https://github.com/mapbox/react-native-mapbox-gl/blob/master/API.md#custom-styles to integrate mapbox into my my react-native app and I am having trouble changing the "pitch" to be other than the default 0.

Here's what I have:

     class MapExample extends Component {
      state = {
        pitch: 50,
        zoom: 18,
        userTrackingMode: Mapbox.userTrackingMode.follow
      };

render() {
    StatusBar.setHidden(true);
    return (
      <View style={styles.container}>
        <MapView
          ref={map => { this._map = map; }}
          style={styles.map}
          pitch={this.state.pitch}
          initialZoomLevel={this.state.zoom}
          styleURL={'mapbox://styles/ctsygiel/cj2wllwes001p2rpmb1yup02a'}
        />
      </View>
    );
0

There are 0 best solutions below