-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrecinct6.html
299 lines (270 loc) · 10.1 KB
/
Precinct6.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
<!DOCTYPE html>
<html>
<head>
<title>Land Ownership in 6th Precinct</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html,
body,
#basemap {
height: 100%;
padding: 0;
margin: 0;
}
#content{
height:100%;
overflow-y:scroll;
z-index: 100;
}
#readMethods {
color: blue;
}
}
.no-padding {
padding-left:0px;
padding-right: 0px;
}
#footnotes p {
font-size: 11px;
line-height: 14px;
margin: 10px 0;
border-top: 2px dotted #ddd;
padding-top: 5px;
}
.nav {
position: relative;
display: block;
}
.navbar
{margin-bottom: 0px;}
.wrapper{
position:absolute;
top:122px;
left:20px;
width:37%;
height:77%;
overflow-y:auto;
z-index: 1000;
margin: 0;
padding: 5px 10px 10px 10px;
background-color: #fff;
/* background-color: rgba(255,255,255,0.95);*/
box-shadow: 0 5px 5px rgba(0, 0, 0, 1);
border-radius: 5px;
}
.cartodb-zoom {
float:right;
}
.cartodb-logo {
display:none !important;
}
.btn {
margin: -4px 1px;
}
.leg {
margin: 10px 1px;
}
.byline{
font-family: Georgia,serif;
margin: -5px 0 0 0;
font-size: 12px;
font-weight: normal;
line-height: 20px;
display: block;
color: #000;
text-align: left;
/*#ff5443*/
}
.dateline{
font-family: Arial,sans-serif;
margin: -8px 0 0 0;
font-size: 10px;
line-height: 13px;
text-transform: uppercase;
letter-spacing: .5px;
color: #333;
text-align: left;
}
.shadow {
display:none;
background:#000;
position: absolute;
left:0;
top:0;
opacity: .8;
z-index:100;
height:100%;
width:100%;
}
element.style {
}
.leaflet-left {
margin-left: 200px;
margin-top: 118px;
}
.leaflet-container a {
color: #93b9c7;
}
.leaflet-control-zoom-out{
position: absolute;
top: 100px
left: 100px;
}
</style>
<link rel="stylesheet" href="http://libs.cartodb.com/cartodb.js/v3/3.11/themes/css/cartodb.css" />
<!--adding jquery autocomplete plugin-->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="jquery.geocomplete.js"></script>
</head>
<body>
<div id="basemap"></div>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="http://libs.cartodb.com/cartodb.js/v3/3.11/cartodb.js"></script>
<div class='cartodb-legend category'>
<div class="legend-title" style="color:#284a59"><h2>Parcel Ownership</h2></div><hr></hr>
<ul>
<li><div class="bullet" style="background-color:#FF6600"></div><h3>Land Bank Owned Parcel</h3></li>
<li><div class="bullet" style="background-color:#636362"></div><h3>City Owned Parcel</h3></li>
<!-- <li><img src="https://cdn0.iconfinder.com/data/icons/black-icon-social-media/512/099280-blinklist-logo.png" alt="Mountain View" style="width:20px;height:20px;"></img> -->
<h4>Search for an Address</h4>
<br></br><br></br>
<small>Data Sources: <a href="http://www.buildingdetroit.org/" target="_blank">Detroit Land Bank Authority</a> and <a href="https://data.detroitmi.gov/" target="_blank">City of Detroit</a></small> |
<small> Created by: <a href="http://www.romogis.com" target="_blank">RomoGIS</a></small>
</ul>
<br/>
</div>
<style>
a {
color: #95c1e5;
}
p.small {
line-height: 90%;
}
p.medium{
line-height: 100%;
}
p.big {
line-height: 200%;
}
div.cartodb-searchbox {
width: 250px;
position: absolute; left:30px; z-index: 150; top: 138px;
}
div.cartodb-searchbox input.text {
width: 244px;
left: 5px!important;
}
.pac-container:after{
content:none !important;
}
div.cartodb-legend {position: absolute; left: 20px; width: 250px; height: 230px; top: 20px;}
div.cartodb-legend{padding-top: 0px; padding-bottom: 5px;}
</style>
<script>
function main() {
// initialize the map on the "map" div with a given center and zoom value
var basemap = L.map('basemap', {
zoomControl: false
, center: [42.366764, -83.235301]
, zoom: 14
});
(function ()
{
var control = new L.Control({position:'topleft'});
control.onAdd = function(map) {
var azoom = L.DomUtil.create('a','resetzoom');
azoom.innerHTML = "Reset Zoom";
L.DomEvent
.disableClickPropagation(azoom)
.addListener(azoom, 'click', function() {
map.setView(map.options.center, map.options.zoom);
},azoom);
return azoom;
};
return control;}())
.addTo(basemap);
// add a nice baselayer from Cartodb
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '<a href="https://www.linkedin.com/in/frank-romo-384aa5aa?trk=prof-samename-name" target="_blank">RomoGIS</a>'
})
.addTo(basemap);
cartodb.createLayer(basemap, 'https://fromo.carto.com/api/v2/viz/fbdea736-4939-11e6-9af9-0e3a376473ab/viz.json')
.addTo(basemap)
.on('done', function (layer) {
// get sublayer 0 and set the infowindow template
var sublayer = layer.getSubLayer(0);
//Adding search bar to the map
var v = cdb.vis.Overlay.create('search', basemap.viz, {})
v.show();
$('#basemap')
.append(v.render()
.el);
//Adding placeholder to search box
$('.cartodb-searchbox')
.find('input.text')
.attr('placeholder', 'Search Location...');
//calling geocomplete plugin
$('.cartodb-searchbox')
.find('input.text')
.geocomplete({
basemap: '#basemap'
});
//place marker function for saving zooming
var arr, count = 0
, marker;
var placeMarker = function (event, result) {
count++;
console.log(count);
if (count == 1) {
//creating empty array
arr = [];
//storing latitute for current location
arr[0] = result.geometry.location.lat();
//storing langitude for current location
arr[1] = result.geometry.location.lng();
//adding lan and lat value to marker object
marker = L.marker([arr[0], arr[1]]);
//adding marker object to map
marker.addTo(basemap);
//Adding zoom level
basemap.setZoom(14);
//Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.
basemap.panTo([arr[0], arr[1]]);
} else {
//removing existing layer from the map
basemap.removeLayer(marker);
//creating empty array
arr = [];
//storing latitute for current location
arr[0] = result.geometry.location.lat();
//storing langitude for current location
arr[1] = result.geometry.location.lng();
//adding lan and lat value to marker object
marker = L.marker([arr[0], arr[1]]);
//adding marker object to map
marker.addTo(basemap);
//Adding zoom level
basemap.setZoom(14);
//Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.
basemap.panTo([arr[0], arr[1]]);
}
}
//calling place marker function
$('.cartodb-searchbox')
.find('input.text')
.bind("geocode:result", placeMarker);
$('.cartodb-searchbox')
.find('input.submit')
.detach();
})
.on('error', function () {
console.log("some error occurred");
});
}
window.onload = main;
</script>
</body>
</html>