ios - react native : Pass target Location onPress to google maps or ios maps and execute a GPS Navigation towards said target

标签 ios google-maps gps react-native

我正在寻找一种方法来为应用程序用户启用简单的功能。 预期的用例是——用户点击我的应用程序中的联系按钮——查看我们的联系方式,然后按下“导航到”按钮,该按钮执行他的导航应用程序并启动 GPS 导航,指向转移到的目标触摸按钮。

到目前为止,我只找到了一个自定义 map 实现到 react native 应用程序中以显示带有 map 的一些位置 - 但没有打开导航应用程序并导航到目标的解决方案。

有可能吗? (一个简单的链接就足以作为回复 - 我可能在这里错过了一些基本的东西:)) 谢谢你的帮助

最佳答案

在 View 中你可以如下添加

<TouchableHighlight ref="statusbutton" onPress={this.showPopover.bind(this,this)}>
                    <View style={styles.mainStatus}></View>
</TouchableHighlight>

在方法中

showPopover(self,event) {
    self.refs.statusbutton1.measure((ox, oy, width, height, px, py) => {
        //you can use the px and py values here.
    });
}

关于ios - react native : Pass target Location onPress to google maps or ios maps and execute a GPS Navigation towards said target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35430350/

相关文章:

iphone - 检查 objective-c 枚举是否存在

android - 在 Google map 中,当应用程序从最小化状态最大化时,为什么不再调用 OnLocationChanged()?

javascript - 托管后 Google map 未在 Angular View 中呈现

android - 从 Android 检索 gps 修复中使用的卫星数量

ios - 当前位置在 swift 3 中没有完美显示

ios - 如何在 xcode 中同时调试两个应用程序?

ios - UITextView 高度未在 UITableViewCell 中调整大小

google-maps - 动态谷歌地图信息窗口加载循环中最后一条记录的内容

Android View.setKeepScreenOn() - 它在 View 消失时适用吗?

ios - WriteToFile 不工作 swift