-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (62 loc) · 1.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<title>Distance Comparator</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0px;
padding: 0px
}
* {
box-sizing: border-box;
}
.map-placeholder {
width: 50%;
height: 100%;
float: left;
}
.map-placeholder:first-child {
border-right: 2px dashed gray;
}
.search-box {
margin-top: 10px;
margin-right: 10px;
padding: 0 8px 0 8px;
border: none;
font-size: 15px;
font-family: "Helvetica Neue", Helvetica, sans-serif;
text-overflow: ellipsis;
width: 40%;
min-width: 190px;
height: 32px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,places"></script>
<script src="distance-comparator.js"></script>
<script>
function initialize() {
var mapSettings = DistanceComparator.decodeStateFromString(getLocationHash());
var comparator = new DistanceComparator.DistanceComparator(
document.getElementById("map-canvas"), mapSettings);
comparator.setStateChangeHandler(function(state) {
window.history.replaceState(null, null, "#" + DistanceComparator.encodeStateToString(state));
});
}
function getLocationHash() {
var hash = window.location.hash;
if (hash.length > 0) {
hash = hash.substring(1);
}
return hash;
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<span id="map-canvas"></span>
</body>
</html>