Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (43 sloc) 1.57 KB
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDXU3kkO3qUQ1eK6_YqlvIIT0n2lOAyZHk&sensor=false">
</script>
<script type="text/javascript">
function initialize() {
// https://developers.google.com/maps/documentation/javascript/reference
var mapOptions = {
center: new google.maps.LatLng(44, -68),
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
var photos = <%= photos %>;
for (var i=0; i < photos.length; i++) {
var coord = new google.maps.LatLng(photos[i].latitude, photos[i].longitude);
var marker = new google.maps.Marker({
position: coord,
map: map,
title: photos[i].filename
});
google.maps.event.addListener(marker, 'click', function() {
var info = new google.maps.InfoWindow({
content: '<img src="' + this.filename + '" width="300">'
}).open(map, this.marker);
}.bind({filename: photos[i].filename, marker: marker}));
}
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.