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)
<code>https://www.google.com/maps?q=760+West+Genesee+Street+Syracuse+NY+13204</code>
Code language: HTML, XML (xml)
No starting point (User input required to generate directions).
<code>https://www.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204</code>
Code language: HTML, XML (xml)
With a set location as starting point (Automatically generates directions with no user input required).
<code>https://www.google.com/maps?saddr=760+West+Genesee+Street+Syracuse+NY+13204&daddr=314+Avery+Avenue+Syracuse+NY+13204</code>
Code language: HTML, XML (xml)
With “My Location” as starting point (Automatically generates directions with no user input required).
<code>https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204</code>
Code language: HTML, XML (xml)
Current Location to Latitude and Longitude
<code>https://www.google.com/maps?saddr=My+Location&daddr=43.12345,-76.12345</code>
Code language: HTML, XML (xml)
Query search of a Latitude and Longitude. Also shows setting a default zoom level.
<code>https://www.google.com/maps?ll=43.12345,-76.12345&q=food&z=14</code>
Code language: HTML, XML (xml)
String search as destination
<code>https://www.google.com/maps?saddr=My+Location&daddr=Pinckney+Hugo+Group</code>
Code language: HTML, XML (xml)
Reference:
https://stackoverflow.com/a/22330384
Leave a Reply