从react-native-maps启动Google Maps应用

问题描述 投票:0回答:1

我正在使用react-native-maps在我的应用程序中显示动态地图。我希望Google Maps应用程序在用户按下地图的某个部分,文本或图标时启动,以便他们也可以从外部查看地图。我该如何实现?谢谢。

  <MapView
    showsUserLocation
    style={styles.map}
    initialRegion={{
      latitude: placesLat,
      longitude: placesLng,
      latitudeDelta: 0.0022,
      longitudeDelta: 0.0121
    }}
  >
    <MapView.Marker
      coordinate={{ latitude: placesLat, longitude: placesLng }}
      title={placesTitle}
    />
  </MapView>
android react-native react-native-maps
1个回答
1
投票

onMapPress组件添加MapView.Marker功能prop,并按here所述调用Linking.openUrl。>

© www.soinside.com 2019 - 2024. All rights reserved.