如何在iOS和Android上实现Google地图的反应原生?

时间:2018-06-07 10:10:11

标签: google-maps react-native reactive-programming react-native-android react-native-ios

我已经在我的反应原生项目中实现了地图,但在iOS情况下,观察到Apple地图是可见的,但我需要谷歌地图代替苹果地图。 我已经完成了this link

有人能帮我准确回答吗?

1 个答案:

答案 0 :(得分:0)

GitHubPage of react-native-maps :

对于iOS,除了提供mapStyle之外,您还需要执行以下操作

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

// ...

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

然后添加AirGoogleMaps目录:

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

https://gist.github.com/heron2014/e60fa003e9b117ce80d56bb1d5bfe9e0

还提供了非官方的分步指南