Skip to content

Instantly share code, notes, and snippets.

@fatgy
Created September 29, 2011 09:16
Show Gist options
  • Save fatgy/1250371 to your computer and use it in GitHub Desktop.
Save fatgy/1250371 to your computer and use it in GitHub Desktop.
Pentagon polygon on Google maps
<html>
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var paths = [[
new google.maps.LatLng(38.872886, -77.054720),
new google.maps.LatLng(38.872602, -77.058046),
new google.maps.LatLng(38.870080, -77.058604),
new google.maps.LatLng(38.868894, -77.055664),
new google.maps.LatLng(38.870598, -77.053346)
], [
new google.maps.LatLng(38.871684, -77.056780),
new google.maps.LatLng(38.871867, -77.055449),
new google.maps.LatLng(38.870915, -77.054891),
new google.maps.LatLng(38.870113, -77.055836),
new google.maps.LatLng(38.870581, -77.057037)
]];
function initialize() {
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 16,
center: new google.maps.LatLng(38.8714, -77.0556),
mapTypeId: google.maps.MapTypeId.SATELLITE
});
var poly = new google.maps.Polygon({
paths: paths,
strokeWeight: 3,
fillColor: '#55FF55',
fillOpacity: 0.5
});
poly.setMap(map);
}
</script>
</head>
<body style="margin:0px; padding:0px;" onload="initialize()">
<div id="map" style="width: 480; height: 480;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment