Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created January 3, 2014 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martin9700/8231653 to your computer and use it in GitHub Desktop.
Save martin9700/8231653 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Earthquakes Map</title>
<style>
html, body, #map-canvas {
height: $($Height)px;
width: $($Width)px;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
$Markers
var bounds = new google.maps.LatLngBounds();
var mapOptions = {
mapTypeId: google.maps.MapTypeId.HYBRID,
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
for( i = 0; i < markers.length; i++ ) {
var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
bounds.extend(position);
marker = new google.maps.Marker({
position: position,
map: map,
title: markers[i][0] + "\n" + markers[i][3] + "\nMagnitude: " + markers[i][4]
});
}
if (markers.length > 1) {
map.fitBounds(bounds);
}
else {
map.setCenter(new google.maps.LatLng(markers[0][1],markers[0][2]));
map.setZoom(4);
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment