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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tony McCreathTechnical 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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

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!!!
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.