Current Location - Google Maps - Link to Directions

后端 未结 8 688
长情又很酷
长情又很酷 2020-12-12 16:12

I\'m trying to do what seemed to be an easy thing but has resulted in some confusion. I\'m trying to have a link going to Google Maps with the destination address pre-filled

相关标签:
8条回答
  • 2020-12-12 16:46

    Also, you can try to use

      https://maps.google.com/?daddr=53.9187068,27.5862874
    

    It is works for me on android and ios at least. May be usefull. More details here : https://developers.google.com/maps/documentation/ios/urlscheme?utm_source=welovemapsdevelopers&utm_campaign=GM-for-iOS-sdk-1-7

    0 讨论(0)
  • 2020-12-12 16:50

    If you make the destination and the current location the same that will work.

    So you should copy/past the destination address also in to my location, than plan route and copy the URL.

    This will work

    0 讨论(0)
  • 2020-12-12 16:57

    What you expect to be the users location is not what you expect, "current location" will be taken by google as any other address, and google tries to find a place that matches the query.

    When somebody told you that "current location" will force google to resolve the location of the user, this is wrong.

    You may geolocate the user on your own and then create the link based on the geolocation-result.

    0 讨论(0)
  • 2020-12-12 16:59

    My+Location queryString doesn't work. But Current+Location queryString value is good work.

    True link

    https://www.google.com/maps?saddr=Current+Location&daddr=36.8957642,30.7089634
    
    0 讨论(0)
  • 2020-12-12 17:04

    The answers of GreatBlakes and Jon Alslund-Lanthén suggest a way that sometimes gives you the right result but that can fail if the language of your user isn't English.

    As of 2019, the best way seems to be:

    https://www.google.com/maps/dir/?api=1&destination=Googleplex,+1600+Amphitheatre+Pkwy

    0 讨论(0)
  • 2020-12-12 17:07

    Try taking out a load of the information, and using 'Current+Location' and, oddly, using .co.uk rather than .com.

    The link https://maps.google.co.uk/maps?t=m&f=d&saddr=Current+Location&daddr=312%20Ponce%20De%20Leon%20Boulevard,%20Coral%20Gables,%20FL works as expected for me (Win7, Chrome and IE9, Android Chrome).

    0 讨论(0)
提交回复
热议问题