these-3-words/views/map.html

69 lines
1.6 KiB
HTML
Raw Normal View History

2014-11-17 10:44:55 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2014-11-17 16:11:28 +00:00
<title>These3Words Map</title>
<!-- Style -->
2014-11-17 18:33:38 +00:00
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<style type="text/css">
2014-11-17 18:33:38 +00:00
html, body, #map-canvas {
height: 100%;
margin: 0;
padding: 0;
}
#overlay {
background: rgba(255, 255, 255, .5);
border-radius: 10px;
padding: 0;
position: absolute;
left: 10px;
bottom: 30px;
max-width: 300px;
}
#overlay h4 {
background: rgba(255, 255, 255, .75);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
padding: 10px;
margin: 0;
}
#overlay p {
padding: 10px;
margin: 0;
}
</style>
</head>
<body>
<div id="map-canvas"></div>
2014-11-17 18:33:38 +00:00
<div id="overlay">
<h4>{{ threewords }}</h4>
<p><strong>Lat:</strong> {{ lat }}</p>
<p><strong>Long:</strong> {{ lng }}</p>
</div>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
<script type="text/javascript">
function initialize() {
2014-11-17 15:59:10 +00:00
var loc = {
lat: {{ lat }},
lng: {{ lng }}
};
2014-11-17 15:59:10 +00:00
var map = new google.maps.Map(document.getElementById('map-canvas'), {
center: loc,
zoom: 14
});
var marker = new google.maps.Marker({
position: loc,
map: map,
title: "{{ threewords }}"
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</body>
2014-11-17 10:44:55 +00:00
</html>