Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Earthquakes Map</title>
html, body, #map-canvas {
height: $($Height)px;
width: $($Width)px;
margin: 0px;
padding: 0px
<script src=""></script>
function initialize() {
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]);
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) {
else {
map.setCenter(new google.maps.LatLng(markers[0][1],markers[0][2]));
google.maps.event.addDomListener(window, 'load', initialize);
<div id="map-canvas"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment