How to create a link for all mobile devices that opens google maps with a route starting at the current location, destinating a given place?

前端 未结 10 557
无人及你
无人及你 2021-01-29 17:33

I rather thought this would not be so hard to find out but appearantly it is not easy to find an awesome cross device article, like you\'d expect.

I want to create a lin

10条回答
  •  再見小時候
    2021-01-29 18:19

    The URL syntax is the same regardless of the platform in use

    String url = "https://www.google.com/maps/search/?api=1&query=" + latitude + ","+ 
    longitude;
    

    In Android or iOS the URL launches Google Maps in the Maps app, If the Google Maps app is not installed, the URL launches Google Maps in a browser and performs the requested action.

    On any other device, the URL launches Google Maps in a browser and performs the requested action.

    here's the link for official documentation https://developers.google.com/maps/documentation/urls/guide

提交回复
热议问题