Hi, i used this for registration of new user on my page.
Look at http://adresar.bohyne.net/registrace.php

Because everything is in Czech, I will explain it a little.

1) You need input fields for latitude and longitude. Best approach is
to make them hidden. From my page:
<input type="hidden" id="N" name="north" />
<input type="hidden" id="E" name="east" />

2) On map, create one marker, which is draggable:
var marker1 = new GMarker(new GLatLng(50.028137, 15.200568),
{draggable: true});

of course, setting position of marker is up to you

3) Add listeners to marker, if its dragged - to change value of input
fields:
GEvent.addListener(marker1, "dragend", function() {
          var latlng = marker1.getLatLng();
          document.getElementById("N").value = latlng.lat();
          document.getElementById("E").value = latlng.lng();
        });

4) Because user can click on map to set marker, add listener also to
map:
GEvent.addListener(map1,"click", function(overlay,latlng) {
          marker1.setLatLng(latlng);
          document.getElementById("N").value = latlng.lat();
          document.getElementById("E").value = latlng.lng();
        });
5) You are done :) when posting form, values are passed to script,
because during events are automatically changed (you can verify this
by making inputs visible)


On Jun 14, 4:29 am, Ralph Ames <[email protected]> wrote:
> >Here's my code for now.
>
> We don't look at code, for these reasons.
>
> Please read the posting guidelines and provide a link to your map.
>
> http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...
> nes
>
> http://groups.google.com/group/Google-Maps-API/web/why-including-a-li...
> ritical
>
> Ralph
>
> www.easypagez.com/maps/map_index.html
> -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to