-
Notifications
You must be signed in to change notification settings - Fork 2
/
map5.html
48 lines (47 loc) · 1.67 KB
/
map5.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
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Leaflet Demo</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<link rel="stylesheet" type="text/css" href="MarkerCluster.css">
<link rel="stylesheet" type="text/css" href="MarkerCluster.Default.css">
<style>
#map {
height: 100%;
width: 100%;
}
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="leaflet.markercluster.js"></script>
<script type="text/javascript">
var map = L.map('map').setView([35.7769, -78.6436],8);
L.tileLayer('http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png').addTo(map);
var markers = new L.MarkerClusterGroup({spiderfyOnMapZoom: true}).addTo(map);
$.getJSON('poi_wgs.geojson', function(json, textStatus) {
L.geoJson(json, {
onEachFeature: function (feature, layer) {
//if (feature.properties.CATEGORY== 'Cultural')
//{
var popup = "<p><strong>"+feature.properties.NAME+"</strong></p>"+
"<p>Type: "+feature.properties.ICON+"</p>";
layer.bindPopup(popup);
markers.addLayer(layer);
//}
}
});
});
</script>
</html>