why react-native-maps api is error in my project?



  • I run it in my ios simulator, but some of api document isn't to correctly show ? is my code error? and how add marker in map?

    export default class maptwo extends Component {
        constructor(props){
          super(props);
          this.state = {
            region:{
              latitude: 116.475343,
              longitude: 39.958308,
              latitudeDelta: 0.5,//0.0922,
              longitudeDelta: 0.5,//0.0421,
            },
            point:{latitude:116.475343,longitude:39.958308,}
          }
        }
    onRegionChange(region) {
      this.state.region.setValue(region);
    }
    render() {
      return (
          <MapView
            style={styles.map}
            region={this.state.region}
            mapType={'standard'}
            showsUserLocation={true}
            userLocationAnnotationTitle="this is position imformation title" // --no  not found annotion in anywhere
            followsUserLocation={true}//  --no focus my location
            showsMyLocationButton={true}  //  --no button
            showsCompass={false}// -- not found compass in map
            showsTraffic={true}// --no traffic information
            cacheEnabled={false}
            loadingEnabled={true}// 
            zoomEnabled={true}
            centerCoordinate={this.state.region}
            onPress={ e => console.log(e.nativeEvent)}
         >
          <MapView.Marker draggable
            title={'today is a friday'}
            coordinate={this.state.point}
            onDragEnd={(e) => this.setState({ x: e.nativeEvent.coordinate })}
          />
        </MapView>
      );
    }
    }
    

    0-0...

    0

登录后回复