you can try this way to save lat & lng value for the marker
Hope it helps

function updateMarker(marker, cells, opt_changeColor) {
  var latlng = marker.getPoint();

  cells.desc.innerHTML = " " + Math.round(latlng.y * 100) / 100 + ", "
+
  Math.round(latlng.x * 100) / 100 + " ";

//this way u have inlatx & inlaty for the marker drawn on map
  var inlat=latlng.y;
  var inlongi=latlng.x;

 }

//this allows  add listener for putting marker point on map & then
calculate lat & long for point then you can save it
 var listener = GEvent.addListener(map, "click", function(overlay,
latlng) {

   if (latlng) {

      GEvent.removeListener(listener);

      var marker = new GMarker(latlng, {icon: getIcon(color),
draggable: true});
      map.addOverlay(marker);

        updateMarker(marker, cells);

      GEvent.addListener(marker, "dragend", function() {
        updateMarker(marker, cells);
      });
      GEvent.addListener(marker, "click", function() {
        updateMarker(marker, cells, true);

     });




On Feb 25, 10:38 am, "[email protected]" <[email protected]>
wrote:
> On Feb 24, 9:18 pm, David <[email protected]> wrote:
>
> > I would like to use my API to allow the user to create a marker, then
> > drag it to it's final location within the map.  My problem is then
> > getting the latitude and longitude from the marker into my html form
> > to be submitted.
>
> > Any help is appreciated.
>
> http://code.google.com/apis/maps/documentation/reference.html#GMarker...
>
>   -- Larry

-- 
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