-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (41 loc) · 1.63 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
<!DOCTYPE html>
<html>
<head>
<title>Mobile home parks, RV's & Campsites</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="mobile.css" />
<link rel="stylesheet" href="dist/MarkerCluster.css" />
<link rel="stylesheet" href="dist/MarkerCluster.Default.css" />
<script src="dist/leaflet.markercluster-src.js"></script>
<script type="text/javascript" src="dist/leaflet-hash.js"></script>
<script src="cents.geojson"></script>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
function onEachFeature(feature, layer) {
// does this feature have a property named name?
if (feature.properties && feature.properties.name) {
layer.bindPopup(feature.properties.name);
}
}
var map = L.map('map').setView([35.38, -120.67], 10);
var hash = new L.Hash(map);
L.tileLayer('https://{s}.tiles.mapbox.com/v4/{mapId}/{z}/{x}/{y}.png?access_token={token}', {
attribution: '<a href="https://www.mapbox.com/about/maps/" target="_blank">© Mapbox © OpenStreetMap</a>',
subdomains: ['a','b','c','d'],
mapId: 'slugis.l61emffd',
token: 'pk.eyJ1Ijoic2x1Z2lzIiwiYSI6IlB5TlZENVUifQ.Z597Ia0qffZlYcGpbJtzTA',
maxZoom: 19
}).addTo(map);
var markers = L.markerClusterGroup();
var points = L.geoJson(centroids, {
onEachFeature: onEachFeature
});
markers.addLayer(points);
map.addLayer(markers);
</script>
</body>
</html>