I did look though I kind of just skimmed it as it's all french to me
right now.  I did look a bit more closely after I posted that reply
and I found something that might work then rearranged some things.

Here's my code for now.  I tried creating a hidden form field to pass
the latitude and longitude out but instead it just caused the whole
google map section to fail.  Also, I was wondering how I can limit it
to only one marker being placed at a time.

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/
>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAYSMrUG7bnmKfN6cfS46BTBReDC9YTnfSMpFP2-
qKruQI3FM4DBTDE15GgutWc7C78vvAYbs8eGOTRw" type="text/javascript"></
script>
  </head>
  <body onunload="GUnload()">

    <div id="map" style="width: 550px; height: 450px"></div>

    <script type="text/javascript">

      var lastmarker;

      function createInputMarker(point) {
        var marker = new GMarker(point,{draggable:true,
icon:G_START_ICON});
        GEvent.addListener(marker, "click", function() {
          lastmarker = marker;
        });
        map.addOverlay(marker);
        lastmarker=marker;
        return marker;
      }

      function createMarker(point) {
        var marker = new GMarker(point);
        GEvent.addListener(marker,"click");
        map.addOverlay(marker);
        return marker;
      }

      var map = new GMap2(document.getElementById("map"),
{draggableCursor:"default"});
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(41.8261,-71.403),15);


      GEvent.addListener(map,"click",function(overlay,point){

          createInputMarker(point);
          process();
      });

      function process() {
        var lat = lastmarker.getPoint().lat();
        var lng = lastmarker.getPoint().lng();
        var marker = createMarker(lastmarker.getPoint());
        GEvent.trigger(marker,"click");
      }

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