59

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 and the from address to inherit the user's current location. From what someone else had instructed, if I used 'current location' as the 'from address', it'd do everything for me.

Instead, when I access the URL from a different location, it's still loading the original "current location" and not the actual current location.

I'm sure it's something stupidly easy, but I'm hoping that someone could point me in the right direction.

The link can be found here.

3
  • 3
    Current solution: google.com/maps/dir/… Jul 16, 2018 at 21:25
  • 8
    https://www.google.com/maps/dir/Current+Location/44.277549,-78.338084 Nov 13, 2019 at 3:03
  • 1
    @TimothyZorn this unfortunately doesn't always work. It will often result in a strange error "Google Maps can't find" (sic) and an empty sidebar. May 26, 2021 at 17:37

9 Answers 9

197

For those still looking, here are some methods of linking to Google Maps:

Spaces can be changed to + or encoded as %20.

  • Linking to a location (No directions)

    https://www.google.com/maps?q=760+West+Genesee+Street+Syracuse+NY+13204
    
  • No starting point (User input required to generate directions).

    https://www.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204
    
  • With a set location as starting point (Automatically generates directions with no user input required).

    https://www.google.com/maps?saddr=760+West+Genesee+Street+Syracuse+NY+13204&daddr=314+Avery+Avenue+Syracuse+NY+13204
    
  • With "My Location" as starting point (Automatically generates directions with no user input required).

    https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204
    
  • Current Location to Latitude and Longitude

    https://www.google.com/maps?saddr=My+Location&daddr=43.12345,-76.12345
    
  • Query search of a Latitude and Longitude. Also shows setting a default zoom level.

    https://www.google.com/maps?ll=43.12345,-76.12345&q=food&z=14
    
  • String search as destination

    https://www.google.com/maps?saddr=My+Location&daddr=Pinckney+Hugo+Group
    

Here is a post I made that I will keep updated as there are some even newer ways to do this!

11
  • There are additional ways to do this as well- Check out the link at the bottom of my answer for the most up-to-date syntaxes. May 21, 2014 at 4:51
  • 2
    OMG. thank you. I thought I would have to do some kind of code acrobatics via Gmaps API. I'm so happy. Oct 28, 2014 at 8:41
  • If i give one of these links as a href and open it in a new tab, will it work the same on ios and mobile?
    – Nevin
    Sep 4, 2015 at 10:28
  • 2
    It is April, 2016 and the URLs all seem to work just fine just the way GreatBlakes presented them. Awesome!
    – hndcrftd
    Apr 11, 2016 at 11:49
14

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

3
  • Yes, this is the current right was to do it as according to developers.google.com/maps/documentation/urls/… If you specify don't specify origin as @Christian rightly said, it picks the user's location as default and if the user did not grant browser permission, Google Maps will demand the user for starting point. A better bet is to add the exact destination_id obtainable at developers.google.com/places/place-id to make sure the users are shown the directions to the right destination
    – Obum
    Jun 18, 2020 at 18:31
  • Yep, Only this one working properly. "Current+Location" take city as start point. "My+Location" take district of city as start point.
    – Max Lipsky
    Jan 18, 2021 at 11:30
  • yep, this is the only one that worked for me both on desktop and in mobile, regardless the language of the user. Thanks! Mar 31, 2022 at 11:47
12

Use My Location instead:

https://maps.google.com/?saddr=My%20Location&daddr=myDestinationAddress

Current Location only works on OS'es with English locale setup.

I haven't found any documentation on this. However leaving saddr blank as suggested here https://developers.google.com/maps/documentation/ios-sdk/urlscheme will prompt the user to input start address.

11

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

2
  • 1
    The documentation at developers.google.com/maps/documentation/ios-sdk/… clearly states that if you leave the saddr parameter blank it will take the current location.
    – fsaftoiu
    Apr 19, 2016 at 8:49
  • 1
    Hmm, that's interesting, when I specify something like saddr=My+Location&daddr... Google Maps app doesn't necessarily use my exact current location (every other time it's soo off). But with your solution, it's working just fine.
    – ekashking
    May 12, 2018 at 4:35
3

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
2

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).

1
0

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

I am assuming you want this link to open on a mobile phone.

None of the strings mentioned populated my actual GPS Location on iOS 14 or the recent versions of android.

This is what did work for me,

https://www.google.com/maps/dir//Address1/Address2

// (double slashes intended) - indicates a custom starting point.

On desktop it leave this field unpopulated, but on mobile it takes your actual GPS location.

Looks like I do not need a google api key after all.

-2

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.

5
  • 5
    This isn't specifically true. Try this link to a house in London: maps.google.co.uk/… The only device I've found that it doesn't work on so far are older iPads and iPhones (I've not tested newer ones). Android, IE9 and Chrome (on Windows) all start you at your location.
    – Grim...
    Feb 24, 2013 at 20:42
  • Returns for me anything, but not my current location as start-adress.
    – Dr.Molle
    Feb 24, 2013 at 22:40
  • Hmm, it does for me. How odd. I wonder what the difference is?
    – Grim...
    Feb 25, 2013 at 11:35
  • 1
    It seems Google removed the ability to use strings such as "My location" or "Current location" in the direction fields. We now need to retrieve the current position (navigator.geolocation.getCurrentPosition) and to push it to the google maps start field. Nov 4, 2014 at 22:45
  • The funny thing is that when google map is opened I can actually see my exact current location blinking but Google still doesn't recognize My Location or Current Location and gets a starting point somewhere else.
    – ekashking
    Jun 26, 2018 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.