4

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>
    );
Khurshid Ansari
  • 4,638
  • 2
  • 33
  • 52
Colin Sygiel
  • 917
  • 6
  • 18
  • 29
  • possible that you may need to use setters rather than props https://github.com/mapbox/react-native-mapbox-gl/issues/564 – Denis Tsoi Jun 29 '17 at 04:00

0 Answers0