简体   繁体   English

如何在React和Native上在iOS和Android上实现Google Maps?

[英]How to implement Google maps on iOS and android both in react native?

I have implemented maps in my react native project but in iOS case, its been observed that Apple map is visible, but I need a google map in place of apple map. 我已经在我的react native项目中实现了地图,但是在iOS情况下,可以看到Apple地图是可见的,但是我需要一个Google地图来代替Apple地图。 I have gone through this link . 我已经通过这个链接

Can anyone help me with an accurate answer? 谁能帮助我提供准确的答案?

see at GitHubPage of react-native-maps : GitHubPage上查看react-native-maps:

For iOS, in addition to providing the mapStyle you will need to do the following 对于iOS,除了提供mapStyle之外,您还需要执行以下操作

import MapView, { PROVIDER_GOOGLE } from 'react-native-maps'

// ...

<MapView
  provider={PROVIDER_GOOGLE}
  customMapStyle={MapStyle}
>

Then add the AirGoogleMaps directory: 然后添加AirGoogleMaps目录:

https://github.com/airbnb/react-native-maps/blob/1e71a21f39e7b88554852951f773c731c94680c9/docs/installation.md#ios https://github.com/airbnb/react-native-maps/blob/1e71a21f39e7b88554852951f773c731c94680c9/docs/installation.md#ios

An unofficial step-by-step guide is also available at https://gist.github.com/heron2014/e60fa003e9b117ce80d56bb1d5bfe9e0 也可以从https://gist.github.com/heron2014/e60fa003e9b117ce80d56bb1d5bfe9e0获得非官方的分步指南

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

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