React-Native:Google 地图仅显示徽标、米色背景和制造商

卡洛夫

我正在尝试让 Google 地图在 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 密钥并添加了谷歌地图:教程

这是我的第二页,另一页使用的是weather-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"/>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何更改Google地图制造商集群的默认值?

来自分类Dev

如何更改Google地图制造商集群的默认值?

来自分类Dev

从 Google Places Autocomplete 在 React Native 中获取纬度和经度

来自分类Dev

Google 应用制造商列表视图过滤

来自分类Dev

读取制造商数据BLE设备react-native-ble-plx

来自分类Dev

流星和React Native

来自分类Dev

使用带护照本的Google-oauth和react-native

来自分类Dev

react-native-google-signin和android.support.v4.net不存在错误

来自分类Dev

在 React Native 应用程序和 Expo 中使用 Google Maps 等原生模块

来自分类Dev

React Native:添加Google Maps SDK

来自分类Dev

Google地图仅显示灰色背景,而不显示地图

来自分类Dev

结合React和React-Native

来自分类Dev

在 React 和 React Native 中使用模型

来自分类Dev

在React Native中循环Json和显示

来自分类Dev

在React Native中隐藏和显示组件

来自分类Dev

React Native 显示/隐藏视图

来自分类Dev

显示广告 GridView React Native

来自分类Dev

android native和react native之间的通信

来自分类Dev

React Native和{flex:1}

来自分类Dev

React Native和require('http')

来自分类Dev

React Native和Firebase 3

来自分类Dev

React Native - android 和 iOS?

来自分类Dev

Promises 和 React Native 协助

来自分类Dev

Flex 和布局 (React Native)

来自分类Dev

上传 Ios 应用徽标 In react native

来自分类Dev

区别React Typescript,React JavaScript和React Native?

来自分类Dev

我想在我的 React Native 应用程序中的谷歌地图中显示附近的餐厅。当我调用 Google API nearsearch 它抛出状态:'ZERO_RESULTS'

来自分类Dev

react-native-maps 标记未显示在地图上

来自分类Dev

react-native:如何结合 react-native-router-flux 和 react-native-drawer?

Related 相关文章

热门标签

归档