Using Google Maps to pinpoint an exact location

Objective: I want to let my clients refine my geolocation data.

Here's what I have working so far...

Given a ZIP code and street address, I call a geocoder service and get back a latitude/longitude pair (geolocation).  I can open a new web page with a Google Map showing this geolocation with a pushpin.


I want to enable the client to see and approve that Google Map.  If the client wants to change the location, I want him to be able to reposition the pushpin to the correct location.  When he is satisfied with the final location of the pushpin, I want the client to "click OK" and I want to be able to get the new latitude/longitude pair back into my PHP script.  In a perfect world, the return data would arrive synchronously, as if it were presented in a form via $_POST.


I want the Google Map embedded in my site for consistent look and feel.

Thanks and regards to all,

PS:  I'm comfortable at any level in PHP, and better than novice in Javascript.  I'm looking for documentation links, guidance and code examples that I can adapt.
LVL 111
Ray PaseurAsked:
Who is Participating?
Tony McCreathConnect With a Mentor Technical SEO ConsultantCommented:
I've created the same thing for the same reason. I've just added a downloadable zip to  make it easy to embed it into your own website.

You would have to enhance it to post to a php file and do your submission.


Thanks for your comment.
However, when I want to select something outside australia, The address is not changing.
Is it normal?


Tyler LaczkoCommented:
luckily i monitored this question. what a great solution thank you very much!!!
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tony McCreathTechnical SEO ConsultantCommented:
You should be able to enter any address in the world. Works for me!

You do have to click the go button. (responding to the enter key is on my list)

The downloadable zip version lets you easily specify the starting location
Tyler LaczkoCommented:
for the enter button pressed just place the input boxes in a <form>
Tyler LaczkoCommented:
heres the code if anyone wants it
                <td style="white-space: nowrap;">
                    <b>Address: </b>
                <td style="white-space: nowrap;">
                    <input id="TextBoxAddress" style="width: 266px;" type="text"/></td>
                <td style="white-space: nowrap;" align="right">
                    <input value="Go" onclick="moveEditorMarkerAddress();return false;" type="submit"/></td>

Open in new window

Tony McCreathTechnical SEO ConsultantCommented:
Should work for most. I use Asp.Net and it does not allow you to add your own form tags.

Ray PaseurAuthor Commented:
That is fucking perfect!  Awesome.  Thanks very much for the info - I can adapt it to exactly what I need.
Ray PaseurAuthor Commented:
@Tiggerito: Very cool.  Thanks again, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.