繁体   English   中英

React-Native:Google地图仅显示徽标,米色背景和makter

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM