Skip to content

Instantly share code, notes, and snippets.

@josephhays
Last active August 29, 2015 14:22
Show Gist options
  • Save josephhays/85f9fc0f151d70c52159 to your computer and use it in GitHub Desktop.
Save josephhays/85f9fc0f151d70c52159 to your computer and use it in GitHub Desktop.
Google Maps API Assignment for LighthouseLabs

Google Maps API Assignment for LighthouseLabs

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(40.712, -74.005),
zoom: 8
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
#bodyContent { background-color: grey; }
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true">
</script>
<script type="text/javascript">
alert("I made some... creative changes. Hope they're okay!\nP.S. Map is supposed to center on Whitehorse City Center\nto encapture ALL of downtown.")
function initialize() {
var makeIT = new google.maps.LatLng(60.715530900000005, -135.05009139999999);
var whitehorseCityCenter = new google.maps.LatLng(60.720506, -135.057434);
var lighthouseLabs = new google.maps.LatLng(49.2819054, -123.1081439);
var aquarium;
var harbour;
var map;
var mapOptions = {
zoom: 15,
center: whitehorseCityCenter
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">The Aquarium</h1>'+
'<div id="bodyContent">'+
'<p><b>The Aquarium</b> is the location of <i>Lighthouse Labs</i> experimental remote program in '+'<b>Whitehorse, Yukon</b>. The program was funded by the Yukon Territorial Government.'+
'The program teaches students web development languages such as Ruby, JavaScript and HTML5. '+
'It is held at <a href="http;//www.makeit.com">MakeIT</a>, Yukons leading IT specialists.</p>'+
'<p>See the <a href="http://www.lighthouselabs.ca">Lighthouse Labs</a> website for more information.</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
aquarium = new google.maps.Marker({
position: makeIT,
map: map,
title: 'The Aquarium'
});
google.maps.event.addListener(aquarium, 'click', function() {
infowindow.open(map,aquarium);
});
harbour = new google.maps.Marker({
position: lighthouseLabs,
map: map,
draggable: true,
animation: google.maps.Animation.DROP,
title: 'The Lighthouse'
});
}
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