In ionic我有一个按钮,当用户点击该按钮时,我想打开苹果地图以显示一个地方的位置。
在我的控制器中,我有以下代码:
$scope.openMap = function(){
if($ionicPlatform.is('ios')){
var url="http://maps.apple.com/?address=My+Street+Example"
window.open(url, '_system');
}
}
问题是我需要点击两次才能打开苹果地图。 我第一次点击按钮,代码被执行但从未发生过(并且xcode没有显示任何内容)
苹果地图第二次打开,在xcode调试器中,我看到以下消息:
CDVWebViewDelegate: Navigation started when state=1
Failed to load webpage with error: CDVWebViewDelegate: Navigation started when state=1
Resetting plugins due to page load.
Failed to load webpage with error: Frame load interrupted
有什么问题?为什么我需要点击两次才能打开苹果地图?