How to invoke iPhone Maps for Directions with Current Location as Start Address

后端 未结 16 1658
一整个雨季
一整个雨季 2020-12-02 03:53

I know it\'s possible to start the iPhone maps application by calling openURL on a google maps URL with parameters saddr and daddr wit

16条回答
  •  失恋的感觉
    2020-12-02 04:37

    For iOS6 Maps App, you can just use the same URL posted above http://maps.google.com/maps?saddr=%f,%f&daddr=%@

    but instead of the Google maps URL, you use the url with maps:// resulting in the following URL: maps://saddr=%f,%f&daddr=%@.

    Using 'Current Location' doesn't seem to work, so I stayed with the coordinates.

    Antother good thing: It's backwards compatible: On iOS5, it launches the Google Maps app.

提交回复
热议问题