【发布时间】:2021-12-26 06:17:13
【问题描述】:
当我在做我的毕业设计时,我遇到了 expo/react 原生 mapView 的一些问题,它给了我这个错误,所以请任何人尽快帮助我。
如果你想检查,这是我的代码:
import React, { Component } from "react";
import { View, I18nManager, StyleSheet, } from 'react-native';
import MapView, { Marker } from 'react-native-maps';
I18nManager.allowRTL(false);
export default class MyMapView extends Component {
//default state
constructor(props) {
super(props);
}
render() {
return (
<View style={styles.container}>
<MapView
style={styles.map}
region={{
//we have muliple locations so we pass them here
latitude: this.props.latitude,longitude: this.props.longitude,
latitudeDelta:this.props.latitudeDelta ,
longitudeDelta: this.props.longitudeDelta,
}}
>
<Marker coordinate={{ latitude: this.props.latitude,longitude: this.props.longitude}} />
</MapView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject
},
map: {
...StyleSheet.absoluteFillObject
}
});
【问题讨论】:
标签: javascript react-native expo android-mapview marker