Link to home
Start Free TrialLog in
Avatar of Ray Paseur
Ray PaseurFlag for United States of America

asked on

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.

Required...

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.

Desirable...

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

Thanks and regards to all,
Ray

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.
ASKER CERTIFIED SOLUTION
Avatar of Tony McCreath
Tony McCreath
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tiggerito,

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

Cheers,

Alin34
luckily i monitored this question. what a great solution thank you very much!!!
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
for the enter button pressed just place the input boxes in a <form>
heres the code if anyone wants it
            <tr>
                <td style="white-space: nowrap;">
                    <b>Address: </b>
                </td>
                <form>
                <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>
                </form>
            </tr>

Open in new window

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

Avatar of Ray Paseur

ASKER

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