我正在寻找一种方法来为应用程序用户启用简单的功能。 预期的用例是——用户点击我的应用程序中的联系按钮——查看我们的联系方式,然后按下“导航到”按钮,该按钮执行他的导航应用程序并启动 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/