我试图实现我的反应,本机应用程序MapView
成分,但是当我运行应用程序时,我得到的是一个空白的广场,在那里的地图应(由红色包围使用MapView的时边界。空白地图在反应母语
我使用genymotion
和我有谷歌播放服务进行安装。
这是我的组件看起来像......
class MainMap extends Component {
constructor() {
super();
}
render(){
return (
<View style={styles.container}>
<MapView
style={ styles.map }
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: 'flex-end',
alignItems: 'center',
},
map: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
});
function mapStateToProps(state) {
return {
users: state.users
};
}
export default connect(mapStateToProps)(MainMap);
为什么会这样不行吗?我已经配置更多在我的模拟器中?我注意到这是一个Android的重新发生的问题,但我找不到一个明确的解决方案。
在react-native-maps文档中有一个相当不错的检查列表 https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md#troubleshooting – Thomas