0% found this document useful (0 votes)
55 views2 pages

My Code

my code

Uploaded by

Manoj Manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

My Code

my code

Uploaded by

Manoj Manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style class="text/css">
html,
body,
#map_canvas {
height: 500px;
width: 500px;
margin: 0px;
padding: 0px;
}
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Contact Us</title>
<script async defer src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyDPn493U-0I0glhEh-BSozdvTWI08syAAQ&callback=initMap"
type="text/javascript"></script>
</head>
<body>
<div id="map_canvas" style="width:750px; height:450px; border: 2px solid
#3872ac;"></div>
<script type="text/javascript">
function initialize() {
var map = new google.maps.Map(
document.getElementById("map_canvas"), {
center: new google.maps.LatLng(37.4419, -122.1419),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});

setMarkers(map, locations);

}
google.maps.event.addDomListener(window, "load", initialize);
var locations = [
['Bondi Beach', -33.890542, 151.274856, , , 'Bondi Beach', 4],
['Coogee Beach', -33.923036, 151.259052, , , 'Coogee Beach', 5],
['Cronulla Beach', -34.028249, 151.157507, , , 'Cronulla Beach', 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, , , 'Manly Beach', 2],
['Maroubra Beach', -33.950198, 151.259302, , , 'Maroubra Beach', 1]
];

function setMarkers(map, locations) {


var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < locations.length; i++) {
var item = locations[i];

var myLatLng = new google.maps.LatLng(item[1], item[2]);


bounds.extend(myLatLng);
var address = item[5];

var marker = new google.maps.Marker({


position: myLatLng,
map: map,
});

var content = address;


var infowindow = new google.maps.InfoWindow()

google.maps.event.addListener(marker, 'mouseover', (function(marker, content,


infowindow) {
return function() {
infowindow.setContent(content);
infowindow.open(map, marker);
};
})(marker, content, infowindow));
google.maps.event.addListener(marker, 'mouseout', (function(marker, content,
infowindow) {
return function() {
infowindow.close();
};
})(marker, content, infowindow));

}
map.fitBounds(bounds);
}
</script>
</body>
</html>

You might also like