【问题标题】:How to implement Google maps on iOS and android both in react native?如何在 iOS 和 android 上以 react native 实现谷歌地图?
【发布时间】:2018-06-07 10:10:10
【问题描述】:

我已经在我的 react native 项目中实现了地图,但在 iOS 案例中,观察到 Apple 地图是可见的,但我需要一个谷歌地图来代替苹果地图。 我已经通过this link

谁能帮我一个准确的答案?

【问题讨论】:

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


    【解决方案1】:

    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 获得非官方的分步指南

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-20
    • 2016-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多