<br clear="both"/>
<a onclick="javascript:drop_marker()">Center marker</a>
<div id="map" style="width: 100%; height: 300px; margin-top:10px"></div>
<script type="text/javascript">
  var map_marker;
  $(document).ready(
    function () {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(0.0, 0.0), 4);
        map_marker = new GMarker(new GLatLng(0.0,0.0), {'draggable': true});
        map.addOverlay(map_marker);
        map.addControl(new GLargeMapControl());
        GEvent.addListener(map_marker, "dragend", 
          function() {
            var point = map_marker.getLatLng();
            $('#lat input')[0].value=point.lat();
            $('#lon input')[0].value=point.lng();
          }
        );
      }
    }
  );
  
  $(document).unload(function () {GUnload()});
  
  function drop_marker() {
    var point = map.getCenter();
    map_marker.setLatLng(point);  
  }
</script>