2017-04-26 81 views
0

我正在使用Angular/Javascript/Ionic打开本机Apple Maps并导航到我设置的地址,但我无法使其工作。它现在的作用是打开本地地图,就是这样。我需要手动点击Apple Maps中的“导航”,才能真正开始导航。如何通过应用程序立即启动导航?

我想要什么?我希望它立即导航。所以,我想是这样的:

enter image description here

我现在所拥有的,是这样的:

enter image description here

这是我的代码:

$scope.openNavigator = function() { 
    var geoString = ''; 

    if(ionic.Platform.isIOS()) { 
      url = 'http://maps.apple.com/maps?q=' + encodeURIComponent(address); 
    } 

    window.open(geoString, '_system'); 
} 

我怎么能更新我的代码段来做到这一点?有什么我需要做的,以获得直接的导航工作?

回答

0

当你给源和目的地输入导航将工作:

http://maps.apple.com/?saddr=Cupertino&daddr=San+Francisco 

例如

url = 'http://maps.apple.com/maps?saddr='+sourceAddr+'&daddr='+destAddr; 
相关问题