在 Android 上具有特定地址的 React-native 打开谷歌地图

chn*_*ing 3 android google-maps react-native

所以我想从我的 react-native 应用程序中打开带有特定地址的谷歌地图应用程序,但我发现的所有模块都需要知道我不知道的地址的确切纬度和经度,我只希望应用程序本身通过给它的地址。

什么是最好的方法呢?有没有我可以使用的特定网址?

Ahm*_*Ali 6

您可以使用 Linking Api 来做到这一点

Linking.openURL('https://www.google.com/maps/search/?api=1&query=centurylink+field');
Run Code Online (Sandbox Code Playgroud)

只需将查询值更改为您想要的值

  • 根据这个 https://facebook.github.io/react-native/docs/linking.html 我只能在我弹出我的项目时使用它,我现在不想这样做。还有其他选择吗? (2认同)