@@ -67,8 +67,6 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
67
67
68
68
< div id ='map '> </ div >
69
69
70
- < script type ="text/javascript " src ="js/fbc.js "> </ script >
71
- < script type ="text/javascript " src ="js/fbc-large-zones.js "> </ script >
72
70
< script type ="text/javascript " src ="js/permitted-use-table-by-zone.js "> </ script >
73
71
74
72
< script type ="text/javascript ">
@@ -78,9 +76,6 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
78
76
keyboard : false
79
77
} )
80
78
81
-
82
-
83
-
84
79
const colors = {
85
80
'C3' : { 'color' : 'f1dbda' , 'name' : 'C3 Community 3' } ,
86
81
'C4' : { 'color' : 'c4a4a6' , 'name' : 'C4 Community 4' } ,
@@ -104,41 +99,17 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
104
99
'UX4' : { 'color' : 'afbcc2' , 'name' : 'UX4 Urban Flex 4' } ,
105
100
'UX5' : { 'color' : '6f809a' , 'name' : 'UX5 Urban Flex 5' }
106
101
}
107
- const map = L . map ( 'map' ) . setView ( [ 41.496273 , - 81.633495 ] , 13 ) ;
102
+ const map = L . map ( 'map' ) . setView ( [ 41.495721047150596 , - 81.67991638183595 ] , 13 ) ;
108
103
109
104
const tiles = L . tileLayer ( 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.{ext}' , {
110
- minZoom : 0 ,
111
- maxZoom : 20 ,
112
- ext : 'png' } ) . addTo ( map ) ;
113
-
114
- // control that shows state info on hover
115
- const info = L . control ( ) ;
116
-
117
- info . onAdd = function ( map ) {
118
- this . _div = L . DomUtil . create ( 'div' , 'info' ) ;
119
- this . update ( ) ;
120
- return this . _div ;
121
- } ;
122
-
123
- info . update = function ( props ) {
124
- const contents = props ? `<b>Parcel PIN: ${ props . parcelpin } </b><br />Zoning District: ${ colors [ props . fbc_zoning ] [ 'name' ] } ` : 'Hover over a parcel' ;
125
- // this._div.innerHTML = `<h4>Cleveland's Form-Based Zoning Code</h4>${contents}`;
126
- } ;
127
-
128
- // info.addTo(map);
129
-
105
+ minZoom : 0 ,
106
+ maxZoom : 20 ,
107
+ ext : 'png' }
108
+ ) . addTo ( map ) ;
130
109
131
110
// get color depending on population density value
132
111
function getColor ( d ) {
133
- // console.log(d)
134
112
return '#' + colors [ d ] [ 'color' ] ;
135
- return d > 1000 ? '#800026' :
136
- d > 500 ? '#BD0026' :
137
- d > 200 ? '#E31A1C' :
138
- d > 100 ? '#FC4E2A' :
139
- d > 50 ? '#FD8D3C' :
140
- d > 20 ? '#FEB24C' :
141
- d > 10 ? '#FED976' : '#FFEDA0' ;
142
113
}
143
114
144
115
function style ( feature ) {
@@ -174,13 +145,11 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
174
145
} ) ;
175
146
176
147
layer . bringToFront ( ) ;
177
-
178
- // info.update(layer.feature.properties);
179
148
}
180
149
181
150
/* load parcels in the FBC areas */
182
151
var geojson ;
183
- fetch ( 'js/fbc-parcels.geojson' ) // Replace with the path to your GeoJSON file
152
+ fetch ( 'js/fbc-parcels.geojson' )
184
153
. then ( response => {
185
154
if ( ! response . ok ) {
186
155
throw new Error ( "Network response was not ok" ) ;
@@ -194,24 +163,34 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
194
163
} ) . addTo ( map ) ;
195
164
map . fitBounds ( geojson . getBounds ( ) ) ;
196
165
} ) ;
197
-
198
-
199
166
200
- // add zone labels
201
- const geojsonZones = L . geoJson ( zones , {
202
- style : styleZones ,
203
- interactive : false ,
204
- onEachFeature : function ( feature , layer ) {
205
- var centroid = turf . centroid ( feature ) ;
206
- var latLng = L . latLng ( centroid . geometry . coordinates [ 1 ] , centroid . geometry . coordinates [ 0 ] ) ;
207
- var tooltip = L . tooltip ( {
208
- permanent : true ,
209
- direction : 'center' ,
210
- className : 'geojson-label'
211
- } ) . setContent ( feature . properties . fbc_zoning ) . setLatLng ( latLng ) ;
212
- layer . bindTooltip ( tooltip ) ;
213
- }
214
- } ) . addTo ( map ) ;
167
+ var geojsonZones ;
168
+ fetch ( 'js/fbc-large-zones.geojson' )
169
+ . then ( response => {
170
+ if ( ! response . ok ) {
171
+ throw new Error ( "Network response was not ok" ) ;
172
+ }
173
+ return response . json ( ) ;
174
+ } )
175
+ . then ( data => {
176
+ geojsonZones = L . geoJson ( data , {
177
+ style : styleZones ,
178
+ interactive : false ,
179
+ onEachFeature : function ( feature , layer ) {
180
+ var centroid = turf . centroid ( feature ) ;
181
+ var latLng = L . latLng ( centroid . geometry . coordinates [ 1 ] , centroid . geometry . coordinates [ 0 ] ) ;
182
+ var tooltip = L . tooltip ( {
183
+ permanent : true ,
184
+ direction : 'center' ,
185
+ className : 'geojson-label'
186
+ } ) . setContent ( feature . properties . fbc_zoning ) . setLatLng ( latLng ) ;
187
+ layer . bindTooltip ( tooltip ) ;
188
+ }
189
+ } ) . addTo ( map ) ;
190
+ map . fire ( 'zoomend' ) ;
191
+ } ) ;
192
+
193
+
215
194
216
195
function resetHighlight ( e ) {
217
196
geojson . resetStyle ( e . target ) ;
@@ -254,67 +233,7 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
254
233
mouseout : resetHighlight ,
255
234
click : openThePopup
256
235
} ) ;
257
-
258
- // popup_data = '<h2>Parcel '+feature.properties.parcelpin+' <a target="_blank" href="http://neocando.case.edu/cando/propLaunch.jsp?type=aud&parcel='+feature.properties.parcelpin+'"><i class="fa-solid fa-link"></i></a></h2><h3>Zoning: '+colors[feature.properties.fbc_zoning]['name']+'</h3><div style="height:100px;overflow:hidden;overflow-y:scroll;"><b>Property Uses:</b><br><table class="table table-striped">';
259
-
260
- // for (const [key, value] of Object.entries(permitted_uses_by_zone[feature.properties.fbc_zoning])) {
261
- // if (value == 'P') {
262
- // text_value = '<i class="fa-regular fa-circle-check"></i></td><td>OK'
263
- // } else if (value == 'C') {
264
- // text_value = '<i class="fa-solid fa-triangle-exclamation"></i></td><td>Conditional, CPC approval req.'
265
- // } else if (value == 'P*') {
266
- // text_value = '<i class="fa-regular fa-circle-check"></i></td><td>OK, w/rules'
267
- // } else if (value == 'C*') {
268
- // text_value = '<i class="fa-solid fa-triangle-exclamation"></i></td><td>Conditional, CPC approval req. & w/rules'
269
- // } else if (value == 'NP') {
270
- // text_value = '<i class="fa-solid fa-square-xmark"></i></td><td>Variance req.'
271
- // }
272
- // popup_data += `<td>${key}</td><td> ${text_value}</td>`;
273
- // }
274
- // popup_data += "</table>";
275
- // popup_data += '<img width=200 src="imgs/'+feature.properties.fbc_zoning + '-SITE.jpg"><br><img width=200 src="imgs/'+feature.properties.fbc_zoning + '-BUILDING.jpg"></div>';
276
-
277
- // layer.bindPopup(popup_data, {
278
- // maxWidth : 560
279
- // });
280
-
281
-
282
-
283
-
284
-
285
236
}
286
-
287
-
288
-
289
- const legend = L . control ( { position : 'bottomright' } ) ;
290
-
291
- legend . onAdd = function ( map ) {
292
-
293
- const div = L . DomUtil . create ( 'div' , 'info legend' ) ;
294
- const grades = [ 0 , 10 , 20 , 50 , 100 , 200 , 500 , 1000 ] ;
295
- const labels = [ ] ;
296
- const zones = [ 'C3' , 'C4' , 'CV' , 'CX3' , 'CX4' ]
297
-
298
- let from , to ;
299
-
300
- // for (let i = 0; i < zones.length; i++) {
301
- // // from = grades[i];
302
- // // to = grades[i + 1];
303
-
304
- // labels.push(`<i style="background:#${colors[zones[i]]}"></i> ${zones[i]}`);
305
- // }
306
-
307
- for ( const [ key , value ] of Object . entries ( colors ) ) {
308
- labels . push ( `<i style="background:#${ value [ 'color' ] } "></i> ${ value [ 'name' ] } ` ) ;
309
- }
310
-
311
- div . innerHTML = labels . join ( '<br>' ) ;
312
- return div ;
313
- } ;
314
-
315
- // legend.addTo(map);
316
-
317
-
318
237
// Minimum zoom level for labels to be visible
319
238
var minLabelZoom = 16 ;
320
239
@@ -335,8 +254,5 @@ <h4 class="modal-title" id="exampleModalLabel"></h4>
335
254
map . fire ( 'zoomend' ) ;
336
255
337
256
</ script >
338
-
339
-
340
-
341
257
</ body >
342
- </ html >
258
+ </ html >
0 commit comments