Phonegap - 在苹果地图应用程序中打开导航方向 [英] Phonegap - Open Navigation Directions in Apple Maps App

查看:171
本文介绍了Phonegap - 在苹果地图应用程序中打开导航方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个变量 - 目的地和源 - 和使用Phonegap,我试图使用jQuery打开外部iPhone苹果地图应用程序的方向。



我使用的代码看起来像这样:

  var url ='http://maps.apple.com/?q = daddr ='+ destination +'& saddr ='+ source; 
window.location = url;

每当我点击相关按钮时,它会打开一个新的视图



如何使用iOS默认地图应用程序打开链接?

解决方案

http://maps.apple.com/?q= 更改为地图 c>

$ 地图:而不是地图: as,而后者将运行正确的应用程序,它会崩溃后立即打开(感谢jprofitt)


I have two variables - Destination and Source - and, using Phonegap, I'm trying to use jQuery to open the external iPhone Apple Maps app with directions.

The code I'm using looks like this:

var url = 'http://maps.apple.com/?q=daddr='+destination+'&saddr='+source;
window.location = url;

Whenever I click the relevant button however, it opens a new view in-app with Google directions as a webview, and I cannot return to the original app.

How can link be opened instead with the iOS default map application?

解决方案

Changing http://maps.apple.com/?q= to just maps: did the trick.


NB: make sure you write maps: and not map: as, while the latter will run the correct app, it will crash immediately after opening (thanks jprofitt)

这篇关于Phonegap - 在苹果地图应用程序中打开导航方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆