问题描述
我有两个变量 - 目的地和源 - 和使用Phonegap,我试图使用jQuery打开外部iPhone苹果地图应用程序的方向。
我使用的代码看起来像这样:
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 - 在苹果地图应用程序中打开导航方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!