1/8/2016 - 9:42 PM

Google Maps examples, directions, lat+lon, query, search ... etc

Google Maps examples, directions, lat+lon, query, search ... etc


Place and Address

Directions (with empty starting point)
The following will link to an address and automatically focus the cursor on the starting location input. The user just types in where they are coming from and the directions are generated.

Directions (with set starting point)
No user input is required as there is a starting and ending direction pre-propagated. Here are a few possible methods for doing so:



Directions (detect user's current location as starting point)
By simply including "Current Location" in the starting point input field, Google will detect the user's location and automatically generate directions based on where they are right now. The string "My Location" can also work, but "Current Location" seems to have a higher success rate.


Directions (with latitude / longitude coordinates)
Instead of using an address, you could also include latitude and longitude coordinates for the destination (or starting point). In this example, we're also using "Current Location" as the starting point.



Directions (multiple destinations from set location)
Using the updated syntax, we can just keep adding destinations to the URL!

Query Search
You could link to a search query of nearby places of an address or in this case coordinates. Change the "q=food" to whatever search you'd like. You can control the default zoom level with ",14z" or "&z=14 at the end of the URL (Zoom range is 0–19. 0 = Furthest Away, 19 = Closest In).


Destination Query
If you don't know the address or GPS coordinates of the destination (or starting point for that matter), you could include a business name as the field instead and let Google determine what you mean. Obviously, you need to be careful with this one because it could serve a different location than you intend.