Wasn't it thebrianschott who wrote:

>I still want to keep the off-map submit button and don't see
>how to do that, unless using this URL method somehow makes
>getting the lat value to the database easier.

It doesn't make any difference where your submit button is.

Once you get the server to a state where it updates the database when
you type the URL into the browser address bar, then all you have to do
is to arrange for the client code to generate the same URL, either by
using a form action, or by using GDownloadUrl.

Suppose you want to send something in this format to your server
   gmaps.php?Server=foo&lat=23.824&lng=-83.987
There are two steps.

1. You need to capture the latlng info into a global variable. Code
executed from HTML runs in global context, so it can only see global
variables.

  var theLatLng;

  GEvent.addListener(map, 'click', function(overlay,latlng){
    dog = false;
    theLatLng = latlng;  // copy the location into a global
  });

2. Send that data to the server

<input type="button" value="Submit" onclick="send();return false" />

function send() {
  if (dog) {
    alert("You must select a point before clicking Submit");
  } else {
    var url = "gmaps.php?Server=foo&lat=" +theLatLng.lat()+
              "&lng=" +theLatLng().lng();
    GLog.write("About to send "+url+ " to the server");
    GDownloadUrl(url,function(){});
  }
}

-- 
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team


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