Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Google map with specific address in a browser [closed]

What is the url structure to search for an address in Google Maps?

I want to offer an address on my website that, when clicked, it will open google maps directly to an address from my script.

I want to create a link <a href="..."></a> which will open a Google Maps browser page that shows a map of a street address from my script.

like image 835
URL87 Avatar asked Dec 11 '14 09:12

URL87


People also ask

How do you make Google Maps open up to a specific location?

Look to the top-left corner of the map, and click the three horizontal menu bars. From the options, select Your places. Next, click Home. Type the name of the location you want to set as your home address in the address field.

Why can't Google Maps open the link?

You may need to update your Google Maps app, connect to a stronger Wi-Fi signal, recalibrate the app, or check your location services. You can also reinstall the Google Maps app if it isn't working, or simply restart your iPhone or Android phone.


1 Answers

You can do it like this:

this is your href: http://maps.google.com/?q= everything that goes after q will be filled in the search filled and submitted, for example: 1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003

So the link looks like this: <a href="http://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003">...</a>

If you need the "q" to be dynamic you can do it with simple jQuery code to update your href.

like image 179
Yakov Avatar answered Sep 20 '22 05:09

Yakov