Вы находитесь на странице: 1из 3

var gislab = new google.maps.LatLng (43.152541, -79.

165450);
var myMapType = google.maps.MapTypeId.HYBRID;
var map;
var marker;

// initialize the google map


function initMap() {
var mapProp = {
center: gislab,
zoom: 18,
mapTypeId: myMapType
};
map = new google.maps.Map(document.getElementById("gMap"), mapProp);
}

// add a bouncing point at gis lab


function addPoint() {
marker = new google.maps.Marker({
position:gislab,
icon:'http://w3schools.com/graphics/pinkball.png',
animation:google.maps.Animation.BOUNCE
});
marker.setMap(map);
};

//Polyline added from GIS lab to Grimsby town


function addPolyline () {
var polylineCoordinates = [
new google.maps.LatLng(43.15191,-79.16576),
new google.maps.LatLng(43.15321,-79.16785),
new google.maps.LatLng( 43.15388,-79.16691),
new google.maps.LatLng(43.15716,-79.16455),
new google.maps.LatLng(43.15888,-79.16389),
new google.maps.LatLng(43.1675,-79.20508),
new google.maps.LatLng(43.16832,-79.21059),
new google.maps.LatLng(43.17051,-79.21954),
new google.maps.LatLng(43.17289,-79.22936),
new google.maps.LatLng(43.17981,-79.26608),
new google.maps.LatLng(43.18029,-79.31922),
new google.maps.LatLng(43.18137,-79.3646),
new google.maps.LatLng(43.18506,-79.37377),
new google.maps.LatLng(43.18736,-79.41953),
new google.maps.LatLng(43.1886,-79.45893),
new google.maps.LatLng(43.18941,-79.50235),
new google.maps.LatLng(43.19153,-79.53127),
new google.maps.LatLng(43.19571,-79.54786),
new google.maps.LatLng(43.19793,-79.56275),
new google.maps.LatLng(43.20016,-79.56858),
new google.maps.LatLng(43.19911,-79.58253),

];
//Properties of polyline are given
var polylinePath = new google.maps.Polyline ({
path: polylineCoordinates,
strokeColor: "#a845ad",
strokeOpacity: 0.6,
strokeWeight: 6,
});
polylinePath.setMap (map);
map.setCenter(new google.maps.LatLng(43.152541, -79.165450));
map.setZoom(13)
}

//Polygon of Grimsby Town is added


function addPolygon() {
var polygonCoordinates = [
new google.maps.LatLng(43.2268702,-79.6299569),
new google.maps.LatLng(43.2211162,-79.6505563),
new google.maps.LatLng(43.2189899,-79.6430032),
new google.maps.LatLng(43.212985,-79.6388833),
new google.maps.LatLng(43.199722,-79.6454064),
new google.maps.LatLng(43.1973038,-79.642193),
new google.maps.LatLng(43.1952169,-79.6449396),
new google.maps.LatLng(43.1954278,-79.6480295),
new google.maps.LatLng(43.191963,-79.6469995),
new google.maps.LatLng(43.1902109,-79.6415064),
new google.maps.LatLng(43.1898791,-79.6344124),
new google.maps.LatLng(43.1898791,-79.6272026),
new google.maps.LatLng(43.1901294,-79.6217094),
new google.maps.LatLng(43.1888778,-79.6151863),
new google.maps.LatLng(43.1876262,-79.6120964),
new google.maps.LatLng(43.1878766,-79.6011101),
new google.maps.LatLng(43.1871256,-79.5901237),
new google.maps.LatLng(43.1876262,-79.5854889),
new google.maps.LatLng(43.1861243,-79.5769058),
new google.maps.LatLng(43.1831203,-79.5738159),
new google.maps.LatLng(43.1836209,-79.5710693),
new google.maps.LatLng(43.1836209,-79.5659195),
new google.maps.LatLng(43.1823692,-79.5614563),
new google.maps.LatLng(43.1841216,-79.5604263),
new google.maps.LatLng(43.1796154,-79.5501267),
new google.maps.LatLng(43.1783636,-79.5436035),
new google.maps.LatLng(43.1777693,-79.5359013),
new google.maps.LatLng(43.1743577,-79.5326172),
new google.maps.LatLng(43.1893785,-79.5243774),
new google.maps.LatLng(43.1951354,-79.5223175),
new google.maps.LatLng(43.1941343,-79.5288406),
new google.maps.LatLng(43.197388,-79.5384537),
new google.maps.LatLng(43.2011421,-79.545744),
new google.maps.LatLng(43.206898,-79.5601636),
new google.maps.LatLng(43.207899,-79.5666867),
new google.maps.LatLng(43.2056468,-79.5749265),
new google.maps.LatLng(43.2056468,-79.5838529),
new google.maps.LatLng(43.207899,-79.5927793),
new google.maps.LatLng(43.2116524,-79.5993024),
new google.maps.LatLng(43.2154057,-79.6061688),
new google.maps.LatLng(43.2268702,-79.6299569),
];
var polygonPath = new google.maps.Polygon({
path: polygonCoordinates,
strokeColor: "#1a627c",
strokeOpacity: 0.6,
strokeWeight: 6,
fillColor: "#e8f9a4",
fillOpacity: 0.3,
});
polygonPath.setMap(map);
map.setCenter(new google.maps.LatLng(43.15,-79.16));
map.setZoom(9)
}

//map has set to the start


function reset(){
initMap();
}
google.maps.event.addDomListener(window, 'load', initMap);

Вам также может понравиться