Google Maps - Polygon

<!DOCTYPE html>
<html>
<head>
<script src="http://maps.googleapis.com/maps/api/js"></script>

<script>
var center = new google.maps.LatLng(31.1471,75.3412);
var delhi = new google.maps.LatLng(28.6139,77.2090);
var punjab = new google.maps.LatLng(31.1471,75.3412);
var gurgaon = new google.maps.LatLng(28.4595,77.0266);

function initialize()
{
var mapProp = {
center:center,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};

var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
var myTrip = [delhi,punjab,gurgaon,delhi];
var trip_path=new google.maps.Polygon({
path:myTrip, //specifies several latitude/longitude coordinates for the line
strokeColor:"#0000FF", //specifies a hexadecimal color for the line
strokeOpacity:0.8, // specifies the opacity of the line
strokeWeight:2, // specifies the weight of the line's stroke in pixels
fillColor:"#0000FF",
fillOpacity:0.4
}); ...  Read More

Share This: