Created
January 7, 2014 13:32
-
-
Save normansolutions/8299313 to your computer and use it in GitHub Desktop.
For use on blog post: http://www.normansolutions.co.uk/post/plotting-earthquakes-on-a-firefly-vle-page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCircle(magnitude) { | |
return { | |
path: google.maps.SymbolPath.CIRCLE, | |
fillColor: 'red', | |
fillOpacity: .2, | |
scale: Math.pow(2, magnitude) / Math.PI, | |
strokeColor: 'white', | |
strokeWeight: .5 | |
}; | |
} | |
function formatAMPM(date) { | |
var hours = date.getHours(); | |
var minutes = date.getMinutes(); | |
var ampm = hours >= 12 ? 'pm' : 'am'; | |
hours = hours % 12; | |
hours = hours ? hours : 12; // the hour '0' should be '12' | |
minutes = minutes < 10 ? '0' + minutes : minutes; | |
var strTime = hours + ':' + minutes + ' ' + ampm; | |
return strTime; | |
} | |
google.maps.event.addDomListener(window, "load", initialize) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment