-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
131 lines (116 loc) · 3.44 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
<!doctype html>
<html lang="en">
<head>
<title>Panoramic view of Manhattan, showing Brooklyn Bridge under construction</title>
<meta charset="utf-8">
<meta name="viewport"content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
@font-face {
font-family: "Kievit Web";
src: url("http://ux-static.nypl.org.s3-website-us-east-1.amazonaws.com/ff_kievit_web/KievitWeb-Book.woff") format('woff');
}
body {
font-family: 'Kievit Web', 'Helvetica Neue', Helvetica, Helvetica, Arial, sans-serif;
color: rgb(250, 250, 250);
font-size: 14px;
}
header {
max-width: calc(100% - 60px);
}
header a, header a:visited {
color: rgb(250, 250, 250);
}
h1 {
padding-bottom: 6px;
}
h2 {
color: rgb(240, 240, 240);
}
header {
padding: 20px;
text-shadow: 2px 2px black;
position: absolute;
z-index: 999;
}
#map {
position: absolute;
width: 100%;
height: 100%;
}
.leaflet-container {
background-color: black;
}
</style>
</head>
<body>
<header>
<h1>
Panoramic view of Manhattan, showing Brooklyn Bridge under construction
</h1>
<h2>
Joshua H. Beal, 1876 — from <a href="http://digitalcollections.nypl.org/items/bceb5a80-d567-0131-e064-58d385a7bbd0">The New York Public Library Digital Collections</a>
</h2>
</header>
<article>
<section id='map' />
</article>
<script>
var geojsonStyle = {
radius: 5,
fillColor: '#0ff0ee',
color: '#000',
weight: 1,
fillOpacity: 0.8
}
var tileUrl = 'tiles/{z}/{x}/{y}.png';
var map = L.map('map', {
minZoom: 3,
maxZoom: 8,
zoomControl: false
})
map.addControl(L.control.zoom({position: 'topright'}))
L.tileLayer(tileUrl, {
tms: true,
attribution: 'NYPL Digital Collections - <a href="http://digitalcollections.nypl.org/about#use">No known US copyright restrictions; other rights restrictions may apply</a>'
}).addTo(map)
map.setView([-84, -80], 5)
map.on('click', function (event) {
var feature = {
type: 'Feature',
properties: {
name: '',
url: ''
},
geometry: {
type: 'Point',
coordinates: [
event.latlng.lng,
event.latlng.lat
]
}
}
console.log('Add this to `places.json`:')
console.log(JSON.stringify(feature, null, 2))
})
// d3.json('places.json', function (places) {
// var geojsonLayer = new L.geoJson(places, {
// style: geojsonStyle,
// pointToLayer: function (feature, latlng) {
// return L.circleMarker(latlng, geojsonStyle)
// },
// onEachFeature: function (feature, layer) {
// var html = '<a href="' + feature.properties.url + '">' + feature.properties.name + '</a>'
// layer.bindPopup(html)
// }
// }).addTo(map)
//})
</script>
</body>
</html>