5

I have a form on my web page that includes a postcode. I want to open a new window and display Google Maps with the data from my postcode form. Ideally something like:

www.maps.google.co.uk%postcode=pr87uu 

Is this something I can do easily?

3 Answers 3

3

Just like the Google search you can enter it in the URL as a query, http://maps.google.co.uk/m?q=pr87uu worked perfectly for me. It's a location near Southport, right?

1
6

If you're looking to display it as a normal maps page, you'd want to use http://google.com/maps?q=SE1+1EB (Postcode format doesn't matter.)

But if you're looking to use the data from the page, you should be using the Google Maps API. Doing it by requesting a user-end URL could potentially end up with your server getting banned from making requests.

2

I wanted to update this one as I have taken a look. If you use Google Map search it actually sends you now to this URL:

https://www.google.co.uk/maps/search/SE1+1EB/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy