I have a code like that:
import React, { Component } from 'react'
import MapboxGL from '@react-native-mapbox-gl/maps'
MapboxGL.setAccessToken( 'xxxx' )
export default class DebugMap extends Component {
render() {
return <View style={{ flex: 1}}>
<MapboxGL.MapView
ref={(c) => (this.map = c)}
onPress={v => this.map.moveTo( 40, 10 )}
style={{flex: 1}}>
<MapboxGL.Camera
zoomLevel={10}
centerCoordinate={[50, 20]}
/>
</MapboxGL.MapView>
</View>
}
}
The map is displayed normally an centered around 50, 20
, but if I press it, an error is thrown:
TypeError: _this3.map.moveTo is not a function. (In '_this3.map.moveTo(48, 11)', '_this3.map.moveTo' is undefined)
What am I missing?