简体   繁体   English

在 Expo 中反应原生地图

[英]React Native Maps in Expo

I know we need to add an API key to view a Google map Then, if react-native-maps is integrated with Expo and we use MapView just by importing from React-native. I know we need to add an API key to view a Google map Then, if react-native-maps is integrated with Expo and we use MapView just by importing from React-native. So where to add the API key in native Map Expo?那么在原生 Map Expo 中添加 API 密钥在哪里?

You need to add keys to in your app.json , here's the expo guide you look at expo guide您需要在您的app.json中添加密钥,这是您查看 expo 指南的expo 指南

In app.json, copy the API key from android.config.googleSignIn to android.config.googleMaps.apiKey在 app.json 中,将 API 密钥从 android.config.googleSignIn 复制到 ZC31B32364CE19CA58FCD150A14FZ 密钥到 ZC31B32364CE19CA58FCD150A14FZ 密钥。

It should look like this:它应该如下所示:

{
  "expo": {
    "ios": {
      "config": {
        "googleMapsApiKey": "YOUR_GOOGLE_MAP_API_KEY_HERE"
      }
    },
    "android": {
      "config": {
        "googleMaps": {
          "apiKey": "YOUR_GOOGLE_MAP_API_KEY_HERE"
        }
      }
    },
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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