-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
103 lines (84 loc) · 2.25 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Manhattan's Tiny Parcels</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="./leaflet.css" />
<style>
#map, body, html {
width:100%;
height:100%;
margin:0;
}
body {
background:#444;
}
path {
stroke: rgb(7, 130, 34);
stroke-width: 8px;
fill: #7296FF;
fill-opacity: .8;
stroke-opacity: 1;
}
.address {
font-weight: bold;
font-size: 14px;
}
</style>
</head>
<body>
<div id = 'map'>
</div>
<script src="./leaflet.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
//This map contains parcels that are under 100 sf in Manhattan according to 2014 Pluto Data
var map = L.map('map',{
}).setView([40.733055, -74.003155], 16);
L.tileLayer('http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
minZoom:0,
maxZoom:22,
maxNativeZoom:18
}).addTo(map);
function onEachFeature(feature, layer) {
layer.bindPopup(
"<span class = 'address'>"
+ feature.properties.Address
+ '</span><br/>Owner: '
+ feature.properties.OwnerName
+ '<br/>BBL: '
+ feature.properties.BBL
+ '<br/>Area: '
+ (Math.round(feature.properties.SHAPE_Area * 10) / 10)
+ ' sq.ft.'
);
}
//load polygons
$.ajax({
dataType: "json",
url: "under100sf.geojson",
success: function(data) {
L.geoJson(data.features, {
style: function(feature) {
}
}).addTo(map);
}
}).error(function() {});
//load points
$.ajax({
dataType: "json",
url: "centroids.geojson",
success: function(data) {
L.geoJson(data.features, {
style: function(feature) {
},
onEachFeature: onEachFeature
}).addTo(map);
}
}).error(function() {});
</script>
</body>
</html>