-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathHK_polygon.html
37 lines (29 loc) · 1.26 KB
/
HK_polygon.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
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Layers Control Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="leaflet/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="leaflet/leaflet.ie.css" /><![endif]-->
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script src="polygon.js" type="text/javascript"></script>
<script src="leaflet/leaflet.js"></script>
<script>
var map = L.map('map').setView([22.340185, 114.119503], 10);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.ENAME) {
layer.bindPopup(feature.properties.ENAME);
}
}
L.geoJson(neighbourhoods, {
onEachFeature: onEachFeature
}).addTo(map);
</script>
</body>
</html>