mobile html5 launch phone's native navigation app

前端 未结 5 1138
灰色年华
灰色年华 2021-02-01 07:30

I\'m developing a phonegap/cordova app. Is there a way to open a phone\'s native navigation app within the browser view? Or is there a best practice on opening native map applic

5条回答
  •  轮回少年
    2021-02-01 07:39

    You can open the native navigation app on iOS 5 (Google Maps) and iOS 6 (Apple Maps) by using the magic "maps:" protocol, e.g. window.location = "maps:daddr=50.4,-4.5"

    But to launch the native Google Navigator app on Android you need to use a phonegap plugin. I wrote this one for my own purposes.

    Update The plugin has now been updated for Phonegap 3.x and supports Android, iOS and Windows Phone, including an option to prefer Google Maps on iOS.

    The plugin is here: https://github.com/dpa99c/phonegap-launch-navigator

提交回复
热议问题