-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnaco.html
212 lines (180 loc) · 6.13 KB
/
naco.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
<html>
<head>
<title>Naco or Naco?</title>
<link rel=stylesheet href="lib/css/bootstrap.css" type="text/css">
<link rel=stylesheet href="lib/css/bootstrap-responsive.css" type="text/css">
<link rel=stylesheet href="lib/css/style.css" type="text/css">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="lib/js/jquery.js"></script>
<script src="lib/js/jquery-animate-css-rotate-scale.js"></script>
<style>
#map-canvas {
height: 1000px;
width: 600px;
}
#map-container {height: 60%; width:80%;
border: 2px solid black;
overflow:hidden;
zoom: 1;
}
#header {
height: 40%;
font-family: sans-serif;
}
#zonaBox {
background: #FFF ;
padding: 5px;
margin: 5px;
font-size: 12px;
font-family: Arial, sans-serif;
position: absolute;
top: 350;
left: 50;
}
#mexBox {
background: #FFF ;
padding: 5px;
margin: 5px;
font-size: 12px;
font-family: Arial, sans-serif;
position: absolute;
top: 350;
left: 750;
}
h3 {
margin: 0px;
font-family: sans-serif;
}
h5 {
margin-top: 0px;
font-family: sans-serif;
}
.bad {
color: #ED6E6C;
}
.good {
color: #97AD62;
}
span {
font-family: sans-serif;
}
</style>
<script>
var map;
var poly;
var frontera;
var tableId = '1aJ_-XLrNBF8x1xvmCDBSzStfNh6cKNFEGmgqXiI';
function initialize() {
var cities = new Array();
var naco = new google.maps.LatLng(31.324607,-109.94595);
cities[0] = naco;
var juarez = new google.maps.LatLng(31.748022,-106.413682);
cities[1] = juarez;
var tijuana = new google.maps.LatLng(32.546813,-116.977723);
cities[2] = tijuana;
var reynosa = new google.maps.LatLng(26.078988,-98.271385);
cities[3] = reynosa;
var laredo = new google.maps.LatLng(27.497004,-99.494644);
cities[4] = laredo;
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: naco,
zoom: 14,
mapTypeId: google.maps.MapTypeId.SATELLITE,
draggable: false,
disableDoubleClickZoom: true,
mapTypeControl: false,
navigationControl: true,
panControl: false,
scrollwheel: false,
streetViewControl: false,
scaleControl: false,
zoomControl: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
});
frontera = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: tableId,
},
styles : [{
polylineOptions: {
strokeColor: "#00FF00",
strokeWeight: "5" },
polygonOptions: {
fillColor: '#00FF00',
fillOpacity: 0.3
}
}],
options: {
clickable: false
}
});
frontera.setMap(map);
$('#map-canvas').animate({rotate: '+=630'});
document.getElementById('map-canvas').style.left=140;
document.getElementById('map-canvas').style.top = -200;
document.getElementById('map-canvas').style.position = 'fixed';
revealInfo();
}
function revealInfo() {
var zonaInfo = document.createElement('div');
zonaInfo.id = 'zonaBox';
var zonaContent = "<div style='font-size:12px'><span class='good'>POPULATION</span></br>" + //130464
"<span class='bad'>HIGH SCHOOL GRADUATES</span></br>" + //17.0%
"<span class='good'>EMPLOYMENT</span></br>"// 4.4%
+ "</br><button id='zonaGuess' onclick='guess(this.id);'><label for='mexGuess' id='mexGuessText'>IT\'S MEXICO!</label></input></div>";
zonaInfo.innerHTML = zonaContent;
$('#canvas')[0].appendChild(zonaInfo);
var mexInfo = document.createElement('div');
mexInfo.id = 'mexBox';
var mexContent = "<div style='font-size:12px'><span class='bad'>POPULATION</span></br>" + //130464
"<span class='good'>HIGH SCHOOL GRADUATES</span></br>" + //17.0%
"<span class='bad'>EMPLOYMENT</span></br>"// 4.4%
+ "</br><button id='mexGuess' onclick='guess(this.id);'><label for='mexGuess' id='mexGuessText'>IT\'S MEXICO!</label></input></div>";
mexInfo.innerHTML = mexContent;
$('#canvas')[0].appendChild(mexInfo);
}
function guess(choice) {
$('#map-canvas').animate({rotate: '+=90'});
$('#mexBox').css("left", 450);
$('#zonaBox').css("top", 150).css("left", 450)
$('#mexGuess').remove();
if (choice === "zonaGuess") {
var zona = document.getElementById('zonaBox');
zona.style.border = '3px solid red';
document.getElementById('mexBox').innerHTML="Naco, MEX!";
zona.innerHTML="Wrong.</br>Naco, USA!";
}
else {
var mex = document.getElementById('mexBox');
mex.style.border = '3px solid green';
document.getElementById('zonaBox').innerHTML="Naco, USA!";
mex.innerHTML="Right,</br>Naco, MEX!";
}
}
</script>
</head>
<body onload="initialize()">
<div id="canvas">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="#">Naco</a>
<ul class="nav">
<li><a href="index.html">Draw the Border</a></li>
<li class="active"><a href="#">Naco or Naco?</a></li>
</ul>
</div>
</div>
<div class="container">
<h1>Naco or Naco?</h1>
<p class="lead">The unincorporated town of Naco, Arizona shares the border with... Naco, Sonora.</p>
<p>The map below has been shifted, can you use the demographic data to figure out which Naco belongs in Mexico?</p>
<p>Sources: <a href="http://factfinder2.census.gov/faces/nav/jsf/pages/index.xhtml">American Community Survey</a>, <a href="http://www.snim.rami.gob.mx/">Sistema Nacional de Informacion Municipal</a></span></p>
<small>This is a <a href="http://www.chicagomigrahack.com/">Migrahack</a> prototype! Tweet feedback to <a href="https://twitter.com/DanHillReports">@DanHillReports</a></small>
<div id="map-canvas"></div>
</div>
</div>
</body>
</html>