polygon-simple.html
author sl
Thu, 10 Apr 2014 12:45:33 +0200
changeset 3 54ac29018aaf
permissions -rw-r--r--
Rectangle overlay params:
Adding support for 'cycle' and 'zoom' param.
Fixing issue with step not being interpreted and an integer.
Updating help documentation.
sl@0
     1
<!DOCTYPE html>
sl@0
     2
<html>
sl@0
     3
  <head>
sl@0
     4
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
sl@0
     5
    <meta charset="utf-8">
sl@0
     6
    <title>Simple Polygon</title>
sl@0
     7
    <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
sl@0
     8
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
sl@0
     9
    <script>
sl@0
    10
function initialize() {
sl@0
    11
  var myLatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
sl@0
    12
  var mapOptions = {
sl@0
    13
    zoom: 5,
sl@0
    14
    center: myLatLng,
sl@0
    15
    mapTypeId: google.maps.MapTypeId.TERRAIN
sl@0
    16
  };
sl@0
    17
sl@0
    18
  var bermudaTriangle;
sl@0
    19
sl@0
    20
  var map = new google.maps.Map(document.getElementById('map-canvas'),
sl@0
    21
      mapOptions);
sl@0
    22
sl@0
    23
  var triangleCoords = [
sl@0
    24
      new google.maps.LatLng(25.774252, -80.190262),
sl@0
    25
      new google.maps.LatLng(18.466465, -66.118292),
sl@0
    26
      new google.maps.LatLng(32.321384, -64.75737),
sl@0
    27
      new google.maps.LatLng(25.774252, -80.190262)
sl@0
    28
  ];
sl@0
    29
sl@0
    30
  // Construct the polygon
sl@0
    31
  bermudaTriangle = new google.maps.Polygon({
sl@0
    32
    paths: triangleCoords,
sl@0
    33
    strokeColor: '#FF0000',
sl@0
    34
    strokeOpacity: 0.8,
sl@0
    35
    strokeWeight: 2,
sl@0
    36
    fillColor: '#FF0000',
sl@0
    37
    fillOpacity: 0.35
sl@0
    38
  });
sl@0
    39
sl@0
    40
  bermudaTriangle.setMap(map);
sl@0
    41
}
sl@0
    42
sl@0
    43
google.maps.event.addDomListener(window, 'load', initialize);
sl@0
    44
sl@0
    45
    </script>
sl@0
    46
  </head>
sl@0
    47
  <body>
sl@0
    48
    <div id="map-canvas"></div>
sl@0
    49
  </body>
sl@0
    50
</html>