polygon-simple.html
changeset 0 5ecce0e1ef52
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/polygon-simple.html	Wed Apr 09 12:36:39 2014 +0200
     1.3 @@ -0,0 +1,50 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +  <head>
     1.7 +    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
     1.8 +    <meta charset="utf-8">
     1.9 +    <title>Simple Polygon</title>
    1.10 +    <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
    1.11 +    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    1.12 +    <script>
    1.13 +function initialize() {
    1.14 +  var myLatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
    1.15 +  var mapOptions = {
    1.16 +    zoom: 5,
    1.17 +    center: myLatLng,
    1.18 +    mapTypeId: google.maps.MapTypeId.TERRAIN
    1.19 +  };
    1.20 +
    1.21 +  var bermudaTriangle;
    1.22 +
    1.23 +  var map = new google.maps.Map(document.getElementById('map-canvas'),
    1.24 +      mapOptions);
    1.25 +
    1.26 +  var triangleCoords = [
    1.27 +      new google.maps.LatLng(25.774252, -80.190262),
    1.28 +      new google.maps.LatLng(18.466465, -66.118292),
    1.29 +      new google.maps.LatLng(32.321384, -64.75737),
    1.30 +      new google.maps.LatLng(25.774252, -80.190262)
    1.31 +  ];
    1.32 +
    1.33 +  // Construct the polygon
    1.34 +  bermudaTriangle = new google.maps.Polygon({
    1.35 +    paths: triangleCoords,
    1.36 +    strokeColor: '#FF0000',
    1.37 +    strokeOpacity: 0.8,
    1.38 +    strokeWeight: 2,
    1.39 +    fillColor: '#FF0000',
    1.40 +    fillOpacity: 0.35
    1.41 +  });
    1.42 +
    1.43 +  bermudaTriangle.setMap(map);
    1.44 +}
    1.45 +
    1.46 +google.maps.event.addDomListener(window, 'load', initialize);
    1.47 +
    1.48 +    </script>
    1.49 +  </head>
    1.50 +  <body>
    1.51 +    <div id="map-canvas"></div>
    1.52 +  </body>
    1.53 +</html>