Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何使用Mapbox gl设置初始节距?_React Native_Mapbox_Mapbox Gl_React Native Mapbox Gl - Fatal编程技术网

React native 如何使用Mapbox gl设置初始节距?

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

我正在使用将mapbox集成到我的react本机应用程序中,但我无法将“音高”更改为默认0以外的值

以下是我所拥有的:

     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而不是道具