React native 如何使用Mapbox gl设置初始节距?
我正在使用将mapbox集成到我的react本机应用程序中,但我无法将“音高”更改为默认0以外的值 以下是我所拥有的:React native 如何使用Mapbox gl设置初始节距?,react-native,mapbox,mapbox-gl,react-native-mapbox-gl,React Native,Mapbox,Mapbox Gl,React Native Mapbox Gl,我正在使用将mapbox集成到我的react本机应用程序中,但我无法将“音高”更改为默认0以外的值 以下是我所拥有的: class MapExample extends Component { state = { pitch: 50, zoom: 18, userTrackingMode: Mapbox.userTrackingMode.follow }; render() { StatusBar.set
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>
);
类映射示例扩展组件{
状态={
投球:50分,
缩放:18,
userTrackingMode:Mapbox.userTrackingMode.follow
};
render(){
StatusBar.setHidden(true);
返回(
{this._map=map;}}
style={style.map}
pitch={this.state.pitch}
initialZoomLevel={this.state.zoom}
styleURL={'mapbox://styles/ctsygiel/cj2wllwes001p2rpmb1yup02a'}
/>
);
您可能需要使用setter而不是道具