[英]React-Native: Google maps only showing the logo, beige background and the makter
我試圖讓Google Maps可以在React-Native中使用,但是我只是走得很遠:
我的代碼:
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
import MapView from 'react-native-maps';
class Additional extends Component {
render() {
return (
<View style={styles.container}>
<MapView style={styles.map}
region={{
latitude: 4.895168,
longitude: 52.370216,
latitudeDelta: 0.1,
longitudeDelta: 0.1,
}}
>
<MapView.Marker
coordinate={{
latitude: 4.895168,
longitude: 52.370216
}}
title={"titel"}
description={"descriptie"}
/>
</MapView>
</View>
);
}
}
Additional.navigationOptions = {
title: 'Second Screen Title',
};
const styles = StyleSheet.create({
container: {
flex: 1,
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
justifyContent: 'flex-end',
alignItems: 'center',
},
map: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0
},
});
export default Additional;
我已經按照本教程的api鍵添加了Google Maps: 教程
這是我的第二頁,另一頁正在使用天氣API。 但是據現場調試器稱,沒有什么沖突。
有人知道發生了什么嗎? 謝謝!
編輯/其他信息:我已經在google-api網頁上激活了我的API。
編輯/其他信息: 我的androidmanifest
我缺少一堆權限:
<permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.shop.addtask.permission.MAPS_RECEIVE"/>
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.