-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
289 lines (265 loc) · 7.99 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Slider to change fusiontable maps layers</title>
<link
href="https://code.google.com/apis/maps/documentation/javascript/examples/default.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://piotrkrosniak.github.io/simple-slider.js"></script>
<link href="http://piotrkrosniak.github.io/simple-slider.css" rel="stylesheet"
type="text/css" />
<link href="http://piotrkrosniak.github.io/simple-slider-volume.css" rel="stylesheet"
type="text/css" />
<script type="text/javascript">
function initialize() {
var myLatLng = new google.maps.LatLng(4.9878199334447695, 53.7890625);
map = new google.maps.Map(document.getElementById('map_canvas'), {
center: myLatLng,
zoom: 3,
panControl: false,
zoomControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.LEFT_CENTER
},
mapTypeControl: false,
mapTypeId: 'roadmap'
});
// Replace the xxx with your Fusion Tables IDs.
//You can use FT Wizard http://fusion-tables-api-samples.googlecode.com/svn/trunk/FusionTablesLayerWizard/src/index.html
layer1 = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1sARycbyEEl8obP2dq7o0ZLbCVqI7Ez-N4cjISCA5' //1950
},
styleId: 2,
templateId: 2,
map: map,
});
layer2 = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1Cfy8KVorYYcz6QOqIGAg_X4BpsQ7u5UK1ZVbdyo3' //1960
},
styleId: 2,
templateId: 2,
map: map,
});
layer3 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '10_g5zMJY8aEzE5eNUe00RUPleaGijqrhcx651lQV' //1970
},
styleId: 2,
templateId: 2,
map: map,
});
layer4 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '1lQSIMpLdl0HI2hq_vhPz0FTdbzoXEn3Yx9gqgWqY' //1980
},
styleId: 2,
templateId: 2,
map: map,
});
layer5 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '11enrFB5xvIp_vPn-ZBBt3XFkPCqKiLsQv_IWD7y4' //1990
},
styleId: 2,
templateId: 2,
map: map,
});
layer6 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '1yD-zUilJqgCMertIYiU6y3l-waiSrIouwl7A-mUK' //2000
},
styleId: 2,
templateId: 2,
map: map,
});
layer7 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '1f2K7FpLQKdi52_j_VHWmMlDhOpSQh5ppejGhVil3' //2010
},
styleId: 2,
templateId: 2,
map: map,
});
layer8 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '1VZ6A75d3w-gMhkVAvqvAle2xBGgQuGbk9ndy_XQa' //2013
},
styleId: 2,
templateId: 2,
map: map,
});
layer9.setMap(map);
}
tableidselections = 0;
function changeLayer(tableidselections) {
if (tableidselections == 1950){
clearmap();
layer1.setMap(map); }
if (tableidselections == 1960){
clearmap();
layer2.setMap(map); }
if (tableidselections == 1970){
clearmap();
layer3.setMap(map); }
if (tableidselections == 1980){
clearmap();
layer4.setMap(map); }
if (tableidselections == 1990){
clearmap();
layer5.setMap(map); }
if (tableidselections == 2000){
clearmap();
layer6.setMap(map); }
if (tableidselections == 2010){
clearmap();
layer7.setMap(map); }
if (tableidselections == 2013){
clearmap();
layer8.setMap(map); }
}
function clearmap() {
layer1.setMap(null);
layer2.setMap(null);
layer3.setMap(null);
layer4.setMap(null);
layer5.setMap(null);
layer6.setMap(null);
layer7.setMap(null);
layer8.setMap(null);
}
</script>
<link
href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900%7CQuicksand:400,700%7CQuestrial"
rel="stylesheet" />
<link href="http://piotrkrosniak.github.io/default.css" rel="stylesheet"
type="text/css" media="all" />
<link href="http://piotrkrosniak.github.io/fonts.css" rel="stylesheet"
type="text/css" media="all" />
<!--[if IE 6]><link href="default_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
</head>
<body onload="initialize()">
<a href="https://github.com/piotrkrosniak"><img
title="Fork me on GitHub"
style="border: 0px solid ; position: absolute; top: 0pt; right: 0pt; width: 149px; height: 149px;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"
alt="Fork me on GitHub" /></a>
<div id="header-wrapper">
<div id="header" class="container">
<div id="logo">
<h1><a target="_blank"
href="https://github.com/PiotrKrosniak/FusionTablesSlider">Under-five mortality rate 1950-2013</a></h1>
<hr style="border-top: 1px dotted;" /></div>
<div id="menu">
</div>
</div>
<div id="map_canvas" class="container"
style="width: 1200px; height: 400px;"></div>
<div id="slider" class="container">
<h3>Drag the slider to change Year</h3>
<input data-slider="true" data-slider-values="1950,1960,1970,1980,1990,2000,2010,2013"
data-slider-highlight="true" data-slider-snap="true"
type="text" /></div>
<script>
$("[data-slider]")
.each(function () {
var input = $(this);
$("<span>")
.addClass("output")
.insertAfter($(this));
})
.bind("slider:ready slider:changed", function (event, data) {
$(this)
.nextAll(".output:first")
.html(data.value.toFixed(0));
tableidselections = data.value.toFixed(0);
changeLayer(tableidselections);
});
</script></div>
<div id="page-wrapper">
<div id="page" class="container">
<div id="content">
<div class="title">
<h2>Under-five mortality rate (Trend data including uncertainty ranges) </h2>
</div>
<p>
</p>
<p><a href="http://data.unicef.org/child-mortality/under-five"
target="_blank">UNICEF </a>
</p>
</div>
<div id="sidebar">
<div class="title">
<h2>Project Info </h2>
</div>
<ul style="font-weight: bold;" class="default">
<li><span ="">
<p>FusionTablesSlider
is a simple script for using a JQuery slider to change map
layers from Google Fusion Tables.</p>
</span></li>
</ul>
<div class="section">
<h2>Acknowledgements</h2>
<br />
<p style="font-weight: bold;">FusionTablesSlider uses
James Smiths' <a href="http://loopj.com/jquery-simple-slider/"
target="_blank">jQuery Simple Slider</a></p>
<span style="font-weight: bold;">FusionTablesSlider is
based on Lucas Timmons <a
href="https://github.com/lucastimmons/FusionTablesScrubber/"
target="_blank">FusionTablesScrubber</a><br />
</span></div>
</div>
</div>
</div>
<div class="wrapper">
<div id="three-column" class="container">
<div id="tbox1">
<div class="title">
<h2>Fork me on GitHub</h2>
</div>
<p>This project it's a collaborative project and that you're
welcomed to add improvements.You are granted full rights to contribute
to the project or use it as a starting point for your own project.</p>
<a target="_blank"
href="https://github.com/PiotrKrosniak/FusionTablesSlider/fork"
class="button">Learn More</a> </div>
<div id="tbox2">
<div class="title">
<h2>Visit my blog </h2>
</div>
<p>On my blog you can find tutorials about Geographic Information
System (GIS),Google Maps and how to use Google Fusion table in data
visualization. Please visit me !</p>
<a target="_blank" href="http://piotrgisworks.blogspot.com/"
class="button">Learn
More</a> </div>
<div id="tbox3">
<div class="title">
<h2> JQuery</h2>
</div>
<p>jQuery is a cross-platform JavaScript library designed to
simplify the client-side scripting of HTML. It was released in January
2006 at BarCamp NYC by John Resig. jQuery is the most popular
JavaScript library in use today</p>
<a target="_blank" href="http://jquery.com/"
class="button">Learn
More</a> </div>
</div>
</div>
</body>
</html>