【发布时间】:2019-12-24 11:46:55
【问题描述】:
我是 react native 的初学者,我正在使用 expo 创建 react native 项目。
在我的测试应用程序中,我想使用react native maps。
installing之后:
npm install react-native-maps --save-exact
我的测试项目中没有android 项目用于在 Android 上构建配置!!!!
但应用程序中显示的地图:
import React from 'react';
import {
View,
StyleSheet,
Platform
} from 'react-native';
import MapView from 'react-native-maps';
const region = {
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}
export default TrackingScreen = props => {
return (
<View>
<MapView
style={styles.map}
region={region} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
map: {
width: '100%',
height: '100%'
}
});
【问题讨论】:
标签: react-native expo react-native-maps