draggable polygons

Create draggable polygons.

function initialize() {

  var mapOptions = {
    zoom: 1,
    center: new google.maps.LatLng(24.886, -70.268),
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  var map = new google.maps.Map(document.getElementById(\'map-canvas\'),
      mapOptions);

  var redCoords = [
      new google.maps.LatLng(25.774, -80.190),
      new google.maps.LatLng(18.466, -66.118),
      new google.maps.LatLng(32.321, -64.757)
  ];

  var blueCoords = [
      new google.maps.LatLng(25.774, -60.190),
      new google.maps.LatLng(18.466, -46.118),
      new google.maps.LatLng(32.321, -44.757)
  ];

   Construct the red polygon
  new google.maps.Polygon({
    map: map,
    paths: redCoords,
    strokeColor: \'#FF0000\',
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: \'#FF0000\',
    fillOpacity: 0.35,
    draggable: true,
    geodesic: true
  });

   Construct the blue polygon
  new google.maps.Polygon({
    map: map,
    paths: blueCoords,
    strokeColor: \'#0000FF\',
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: \'#0000FF\',
    fillOpacity: 0.35,
    draggable: true,
    geodesic: false
  });
}

google.maps.event.addDomListener(window, \'load\', initialize);