This repository has been archived by the owner on Dec 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
100 lines (89 loc) · 3.51 KB
/
map.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>IMD Map Explorer</title>
<link rel="stylesheet" type="text/css" href="stylesheets/map.css" />
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false®ion=GB"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="javascripts/raphael.js"></script>
<script type="text/javascript" src="javascripts/swirrl.js"></script>
<script type="text/javascript" src="javascripts/swirrl/map-manager.js"></script>
</head>
<body>
<div id="container">
<div id="info"></div>
<div id="map_canvas"></div>
<div id="map_canvas"></div>
<div id="zoom_warning" style="display:none"><div class="words">Zoom-level too wide. Please zoom in to see the LSOAs</div></div>
<div id="busy_notice" style="display:none"><img src="images/working.gif"/><div class="words">Working...</div></div>
<select id="domain">
<option value="IMD-score">Combined Score</option>
<option value="IMD-housing-score">Housing</option>
<option value="IMD-crime-score">Crime</option>
<option value="IMD-education-score">Education</option>
<option value="IMD-employment-score">Employment</option>
<option value="IMD-health-score">Health</option>
<option value="IMD-income-score">Income</option>
<option value="IMD-environment-score">Environment</option>
</select>
<div id="colour_key_container">
<div id="colour_key"></div>
</div>
<div style="display:none" id="templates"></div>
</div>
<script type="text/javascript">
(function(){
var mapManager
, idleListener = null
, startTime
, map = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: 14,
center: new google.maps.LatLng(53.48, -2.245), // Manchester
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false
});
var mapManager = new swirrl.MapManager(map, "IMD-score"); // initialize with the overall score.
// Handle events coming out of the Map Manager.
$(mapManager).bind('started', function() {
startTime = new Date();
if(idleListener) {
google.maps.event.removeListener(idleListener);
idleListener = null;
}
$("#busy_notice").show();
});
$(mapManager).bind('finished', function() {
window.swirrl.log('busy duration: ' + (new Date() - startTime) + ' ms');
$("#busy_notice").hide();
bindMapIdle();
});
// show warning if zoom too wide
$(mapManager).bind('zoomTooWide', function() {
if (!$("#zoom_warning").is(":visible")) {
$("#zoom_warning").show();
}
});
// hide warning if zoom oK
$(mapManager).bind('zoomOK', function() {
if ($("#zoom_warning").is(":visible")) {
$("#zoom_warning").hide();
}
});
// function to wire up the idleListener
var bindMapIdle = function() {
// if we don't already have an idle-listener, bind one up.
// (fires when the map bounds haven't changed for a bit)
if (!idleListener) {
idleListener = google.maps.event.addListener(map, 'idle', function(e) {
window.swirrl.log('refreshing map');
mapManager.refresh();
});
}
}
// Finally, start listening to Map-Idle events.
bindMapIdle();
})();
</script>
</body>
</html>