-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
602 lines (485 loc) · 25.8 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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<html>
<head>
<!-- Mobile support -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="bootstrap/js/bootstrap.min.js"></script>
<link href="bootstrap/material/css/material-wfont.min.css" rel="stylesheet">
<!--script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=visualization"></script-->
<script src="http://maps.google.com/maps?file=api&v=3.exp&key=&libraries=visualization" type="text/javascript"></script>
<style>
html,body,#cm_map {
width: 100%;
height:100%;
margin: 0px;
padding: 0px
}
#cm_map {
height:calc(100% - 50px);
}
.navbar {margin-bottom: 0}
.x-large {
font-size: 5em;
}
.smmargin {
margin-top: 3pt;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-inverse-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<i class="mdi-action-favorite"></i><i class="mdi-maps-local-hospital"></i><i class="mdi-maps-directions-bike"></i><i class="mdi-social-mood"></i>
Canada Lifestyle & Health Browser
</span>
</div>
<div class="navbar-collapse collapse navbar-inverse-collapse">
<!--ul class="nav navbar-nav">
<li class="active"><a href="javascript:void(0)">Active</a></li>
</ul-->
<ul class="nav navbar-nav navbar-right">
<li><a href="#" onclick="$('#aboutModal').modal();">About<i class="mdi-social-whatshot"></i></a></li>
</ul>
</div>
</div>
<!-- WELCOME -->
<div class="modal fade bs-example-modal-lg" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel" aria-hidden="false">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h1 class="modal-title" id="welcomeModalLabel">Canada Lifestyle & Health Browser</h1>
<h1 class="x-large text-center"><i class="mdi-action-favorite mdi-material-pink"></i><i class="mdi-maps-local-hospital mdi-material-blue"></i><i class="mdi-maps-directions-bike mdi-material-brown"></i><i class="mdi-social-mood mdi-material-orange"></i></h1>
</div>
<div class="modal-body">
<p>This app is designed for those curious about Canadian health populations, by city. If you are curious to know if where you live determines a health status, this is the right app for you. </p>
<p>You can browse different regions in Canada and compare their aggregate scores. Each region provides a unique insight into health status. This aggregated data includes all sexes, all ages, and with the most recent Canadian data from the CCHS survey.</p>
<p>Browse the map to compare scores across the country. Click on a marker too see details about the make up of the regions score!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-raised" data-dismiss="modal">Continue</button>
</div>
</div>
</div>
</div>
<script>$('#welcomeModal').modal();</script>
<!-- ABOUT -->
<div class="modal fade bs-example-modal-lg" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="aboutModalLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h1 class="modal-title" id="aboutModalLabel">Canada Lifestyle & Health Browser
<i class="mdi-action-favorite mdi-material-pink"></i><i class="mdi-maps-local-hospital mdi-material-blue"></i><i class="mdi-maps-directions-bike mdi-material-brown"></i><i class="mdi-social-mood mdi-material-orange"></i></h1>
</div>
<div class="modal-body">
<p>This app is designed for those curious about Canadian health populations, by city. If you are curious to know if where you live determines a health status, this is the right app for you. </p>
<p>You can browse different regions in Canada and compare their aggregate scores. Each region provides a unique insight into health status. This aggregated data includes all sexes, all ages, and with the most recent Canadian data from the CCHS survey.</p>
<h2>About</h2>
<p>
Created by the Smoulder Collective for <a href="http://www.canadianopendataexperience.ca">CODE 2015 Competition</a>
</p>
<h3>Included Data Sets:</h3>
<p>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-raised" data-dismiss="modal">Continue</button>
</div>
</div>
</div>
</div>
<!-- REGION DATA -->
<div class="modal fade" id="regiondataModal" tabindex="-1" role="dialog" aria-labelledby="regiondataModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="regiondataModalLabel"> </h4>
</div>
<div class="modal-body" id="regiondataModalContent">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-raised" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- MAP -->
<div id="cm_map"></div>
<!-- MAP -->
<script type="text/javascript">
//<![CDATA[
var cm_map;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];
// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var cm_baseIcon = new GIcon();
cm_baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
cm_baseIcon.iconSize = new GSize(20, 34);
cm_baseIcon.shadowSize = new GSize(37, 34);
cm_baseIcon.iconAnchor = new GPoint(9, 34);
cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);
// Change these parameters to customize map
var param_wsId = "1";
var param_ssKey = "1RHYkfOsmCEnvjh2A3AzSj77Daelo32BD_S6THD6cruI";
var param_useSidebar = false;
var param_titleColumn = "geography";
var param_descriptionColumn = "score";
var param_latColumn = "latitude";
var param_lngColumn = "longitude";
var param_rankColumn = "score";
var param_iconType = "green";
var param_iconOverType = "blue";
var param_scoreCol = "score";
var param_ZscoreCol = "z-score";
var param_lifeexpectScoreCol = "lifeexpectancyscore";
var param_lifeexpectCol = "lifeexpectancy";
var param_obeseyouthCol = "notbodymassindexself-reportedyouth12to17yearsoldoverweightorobese";
var param_obeseadultCol = "notbodymassindexself-reportedadult18yearsandoveroverweightorobese";
var param_asthmaCol = "notasthma";
var param_arthritusCol = "notarthritis";
var param_bloodpressureCol = "nothighbloodpressure";
var param_diabetesCol = "notdiabetes";
var param_copdCol = "notcopd";
var param_satisfactionCol = "lifesatisfactionsatisfiedorverysatisfied";
var param_belongingCol = "senseofbelongingtolocalcommunitysomewhatstrongorverystrong";
var param_mooddisorderCol = "notmooddisorder";
var param_physicalactivityCol = "physicalactivityduringleisure-timemoderatelyactiveoractive";
var param_smokerCol = "notcurrentsmokerdailyoroccasional";
var param_fruitvegCol = "fruitandvegetableconsumption5timesormoreperday";
var param_drinkingCol = "notheavydrinking";
var param_hasdocCol = "hasaregularmedicaldoctor";
var param_fluvacCol = "influenzaimmunizationlessthanoneyearago";
var param_helmentbikeCol = "wearsahelmetwhenridingabicyclealways";
var param_injuriesCol = "notinjuriesinthepast12monthscausinglimitationofnormalactivities";
/**
* Loads map and calls function to load in worksheet data.
*/
function cm_load() {
if (GBrowserIsCompatible()) {
// create the map
//cm_map = new GMap2(document.getElementById("cm_map"));
cm_map = new google.maps.Map(document.getElementById("cm_map"));
//cm_map.addControl(new GLargeMapControl());
//cm_map.addControl(new GMapTypeControl());
//cm_map.setCenter(new GLatLng( 43.907787,-79.359741), 2);
cm_getJSON();
} else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
}
/**
* Function called when marker on the map is clicked.
* Opens an info window (bubble) above the marker.
* @param {Number} markerNum Number of marker in global array
*/
function cm_markerClicked(markerNum) {
cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);
}
/**
* Function that sorts 2 worksheet rows from JSON feed
* based on their rank column. Only called if column is defined.
* @param {rowA} Object Represents row in JSON feed
* @param {rowB} Object Represents row in JSON feed
* @return {Number} Difference between row values
*/
function cm_sortRows(rowA, rowB) {
var rowAValue = parseFloat(rowA["gsx$" + param_rankColumn].$t);
var rowBValue = parseFloat(rowB["gsx$" + param_rankColumn].$t);
return rowAValue - rowBValue;
}
/**
* Called when JSON is loaded. Creates sidebar if param_sideBar is true.
* Sorts rows if param_rankColumn is valid column. Iterates through worksheet rows,
* creating marker and sidebar entries for each row.
* @param {JSON} json Worksheet feed
*/
function cm_loadMapJSON(json) {
var usingRank = false;
if(param_useSidebar == true) {
var sidebarTD = document.createElement("td");
sidebarTD.setAttribute("width","150");
sidebarTD.setAttribute("valign","top");
var sidebarDIV = document.createElement("div");
sidebarDIV.id = "cm_sidebarDIV";
sidebarDIV.style.overflow = "auto";
sidebarDIV.style.height = "650px";
sidebarDIV.style.fontSize = "11px";
sidebarDIV.style.color = "#000000";
sidebarTD.appendChild(sidebarDIV);
document.getElementById("cm_mapTR").appendChild(sidebarTD);
}
var bounds = new GLatLngBounds();
if(json.feed.entry[0]["gsx$" + param_rankColumn]) {
usingRank = true;
json.feed.entry.sort(cm_sortRows);
}
for (var i = 0; i < json.feed.entry.length; i++) {
var entry = json.feed.entry[i];
if(entry["gsx$" + param_latColumn]) {
var lat = parseFloat(entry["gsx$" + param_latColumn].$t);
var lng = parseFloat(entry["gsx$" + param_lngColumn].$t);
var point = new GLatLng(lat,lng);
/*///////////////////////////////////////////////////////////////////////////////////*/
var modalLabel = entry["gsx$"+param_titleColumn].$t;
var modalContent = "<div class='panel panel-default'><div class='panel-heading'>Overall Score</div><div class='panel-body'>" +
"<h2 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_scoreCol].$t).toFixed(1) + "</h2>" +
"<div class='progress progress-striped'>" +
"<div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_scoreCol].$t + "%'></div></div>" +
"<p class='text-center'>";
var zscore = parseFloat(entry["gsx$" + param_ZscoreCol].$t).toFixed(1);
if(zscore<0) {
modalContent += Math.abs(zscore) + "% below average</p>";
}
else {
modalContent += zscore + "% above average</p>";
}
modalContent += "</div></div>" +
"<div class='container-fluid'><div class='row'><div class='col-sm-6'>" +
"<h3>Health</h3>";
if($.isNumeric(entry["gsx$"+param_lifeexpectCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Life Expectancy</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_lifeexpectCol].$t).toFixed(1) + " years</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_lifeexpectCol].$t + "%'></div></div>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_obeseyouthCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Youth Obesity</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_obeseyouthCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_obeseyouthCol].$t + "%'></div></div>" +
"<p class='text-center'>Aged 12-17 are not overweight or obese <br/><small>(Self-reported)</small></p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_obeseadultCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Adult Obesity</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_obeseadultCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_obeseadultCol].$t + "%'></div></div>" +
"<p class='text-center'>Over the age of 18 are not overweight or obese <br/><small>(Self-reported)</small></p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_asthmaCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Asthma</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_asthmaCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_asthmaCol].$t + "%'></div></div>" +
"<p class='text-center'>Are not affected by Asthma</p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_bloodpressureCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>High Blood Pressure</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_bloodpressureCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_bloodpressureCol].$t + "%'></div></div>" +
"<p class='text-center'>Do not have high blood pressure</p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_diabetesCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Diabetes</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_diabetesCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_diabetesCol].$t + "%'></div></div>" +
"<p class='text-center'>Are not affected by Diabetes</p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_arthritusCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Arthritis</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_arthritusCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_arthritusCol].$t + "%'></div></div>" +
"<p class='text-center'>Are not affected by Arthritis</p>" +
"</div></div>";
}
if($.isNumeric(entry["gsx$"+param_copdCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Chronic Obstructive Pulmonary Disease</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_copdCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_copdCol].$t + "%'></div></div>" +
"<p class='text-center'>Are not affected by Chronic Obstructive Pulmonary Disease (COPD)</p>" +
"</div></div>";
}
modalContent += "<h3>Emotion</h3>";
if($.isNumeric(entry["gsx$"+param_satisfactionCol].$t)) {
modalContent += "<div class='panel panel-default'><div class='panel-heading'>Life Satisfaction</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry["gsx$"+param_satisfactionCol].$t).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry["gsx$"+param_satisfactionCol].$t + "%'></div></div>" +
"<p class='text-center'>Are satisfied or very satisfied with life</p>" +
"</div></div>";
}
modalContent += regiondataPanel(entry["gsx$"+param_belongingCol].$t,
"Sense of Belonging",
"Have a strong sense of belonging to local community");
modalContent += regiondataPanel(entry["gsx$"+param_mooddisorderCol].$t,
"Mood Disorders",
"Do not have mood disorders");
modalContent += "</div> <div class='col-sm-6'>" +
"<h3>Lifestyle</h3>";
modalContent += regiondataPanel(entry["gsx$"+param_physicalactivityCol].$t,
"Physical Activity",
"Are active in physical activity during leisure-time");
modalContent += regiondataPanel(entry["gsx$"+param_smokerCol].$t,
"Smoking",
"Do not smoke");
modalContent += regiondataPanel(entry["gsx$"+param_fruitvegCol].$t,
"Fruit & Vegetables",
"Comsume fruit and vegetables 5 times or more per day");
modalContent += regiondataPanel(entry["gsx$"+param_drinkingCol].$t,
"Heavy Drinking",
"Are not heavy drinkers of alcohol");
modalContent += regiondataPanel(entry["gsx$"+param_hasdocCol].$t,
"Doctor",
"Have a regular medical doctor");
modalContent += regiondataPanel(entry["gsx$"+param_fluvacCol].$t,
"Influenza Immunization",
"Have been immunized for Influenza within the past year");
modalContent += regiondataPanel(entry["gsx$"+param_helmentbikeCol].$t,
"Bike Helments",
"Wear a helment while bicycling");
modalContent += regiondataPanel(entry["gsx$"+param_injuriesCol].$t,
"Significant Injuries",
"Have had no significant injuries in the past year");
modalContent += "</div></div></div>";
var html = "<div style='font-size:12px'>";
html += "<strong>" + entry["gsx$"+param_titleColumn].$t
+ "</strong>";
var label = entry["gsx$"+param_titleColumn].$t;
var rank = 0;
if(usingRank && entry["gsx$" + param_rankColumn]) {
rank = parseInt(entry["gsx$"+param_rankColumn].$t);
}
if(entry["gsx$" + param_descriptionColumn]) {
html += "<br/>" + entry["gsx$"+param_descriptionColumn].$t;
}
html += "</div>";
// create the marker
var marker = cm_createMarker(point,label,html,rank,modalLabel,modalContent);
cm_map.addOverlay(marker);
cm_mapMarkers.push(marker);
cm_mapHTMLS.push(html);
bounds.extend(point);
if(param_useSidebar == true) {
var markerA = document.createElement("a");
markerA.setAttribute("href","javascript:cm_markerClicked('" + i +"')");
markerA.style.color = "#000000";
var sidebarText= "";
if(usingRank) {
sidebarText += rank + ") ";
}
sidebarText += label;
markerA.appendChild(document.createTextNode(sidebarText));
sidebarDIV.appendChild(markerA);
sidebarDIV.appendChild(document.createElement("br"));
sidebarDIV.appendChild(document.createElement("br"));
}
}
}
cm_map.setZoom(cm_map.getBoundsZoomLevel(bounds));
cm_map.setCenter(bounds.getCenter());
}
/**
* Creates marker with ranked Icon or blank icon,
* depending if rank is defined. Assigns onclick function.
* @param {GLatLng} point Point to create marker at
* @param {String} title Tooltip title to display for marker
* @param {String} html HTML to display in InfoWindow
* @param {Number} rank Number rank of marker, used in creating icon
* @return {GMarker} Marker created
*/
function cm_createMarker(point, title, html, rank, modalLabel,modalContent) {
var markerOpts = {};
var nIcon = new GIcon(cm_baseIcon);
if(rank > 0 && rank < 100) {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/marker" + rank + ".png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/marker" + rank + ".png";
nIcon.image = nIcon.imageOut;
} else {
nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconType + "/blank.png";
nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
"markers/" + param_iconOverType + "/blank.png";
nIcon.image = nIcon.imageOut;
}
markerOpts.icon = nIcon;
markerOpts.title = title;
var marker = new GMarker(point, markerOpts);
/*///////////////////////////////////////////////////////////////////////////////////*/
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
$('#regiondataModalLabel').html(modalLabel);
$('#regiondataModalContent').html(modalContent);
$('#regiondataModal').modal();
});
GEvent.addListener(marker, "mouseover", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "mouseout", function() {
marker.setImage(marker.getIcon().imageOut);
});
GEvent.addListener(marker, "infowindowopen", function() {
marker.setImage(marker.getIcon().imageOver);
});
GEvent.addListener(marker, "infowindowclose", function() {
marker.setImage(marker.getIcon().imageOut);
});
return marker;
}
/**
* Creates a script tag in the page that loads in the
* JSON feed for the specified key/ID.
* Once loaded, it calls cm_loadMapJSON.
*/
function cm_getJSON() {
// Retrieve the JSON feed.
var script = document.createElement('script');
script.setAttribute('src', 'http://spreadsheets.google.com/feeds/list'
+ '/' + param_ssKey + '/' + param_wsId + '/public/values' +
'?alt=json-in-script&callback=cm_loadMapJSON');
script.setAttribute('id', 'jsonScript');
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
}
function regiondataPanel(entry_param_column, title, moreinfo) {
var panelHtml;
if($.isNumeric(entry_param_column)) {
panelHtml = "<div class='panel panel-default'><div class='panel-heading'>" +
title + "</div><div class='panel-body'>" +
"<h4 class='text-center smmargin'>" +
parseFloat(entry_param_column).toFixed(1) + "%</h4>" +
"<div class='progress progress-striped'><div class='progress-bar progress-bar-success' style='width: " +
entry_param_column + "%'></div></div>" +
"<p class='text-center'>" + moreinfo + "</p>" + "</div></div>";
}
return panelHtml;
}
setTimeout('cm_load()', 500);
//]]>
</script>
</body>
</html>