【发布时间】:2022-01-17 12:35:27
【问题描述】:
我分配了正确的 Api 密钥,为什么地图没有显示?我 App.js 代码
import MapView from 'react-native-maps';
export default function App() {
return (
<View style={styles.container}>
<MapView
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
我的安卓模拟器显示了这个结果
【问题讨论】:
-
您是否添加了 Google Map API 密钥?
-
是的,我也添加了 Google Map Api,但地图没有显示只有 google 徽标可见
标签: react-native google-maps google-maps-api-3 react-native-maps