-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpart3.html
44 lines (40 loc) · 1.61 KB
/
part3.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
<html>
<head>
<title>Some Page Title</title>
<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://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<style>
#map{ height: 100% }
</style>
</head>
<body>
<div id="map"></div>
<script>
// initialize the map centered on the geographic center of the lower 48
var map = L.map('map').setView([39.833, -98.35], 4);
// load tile layer from mapstack we copied earlier and use the required attribution
L.tileLayer(
'http://{s}.sm.mapstack.stamen.com/((naip,$fff[difference],$fff[@60],$fff[hsl-saturation@90])[multiply],(mapbox-water,$fff[difference],$000[@60],$090d11[hsl-color]))/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>',
// we want to limit the scrollability
maxZoom: 19,
minZoom: 4
}).addTo(map);
// load the geojson file you saved in this directory
$.getJSON("ssa-capitals.geojson",function(data){
// use this to reference the icon in our repo
var booIcon = L.icon({
iconUrl: 'boo.gif',
iconSize: [28, 28]
});
// add it to the map
L.geoJson(data,{
pointToLayer: function(feature,latlng){
return L.marker(latlng,{icon: booIcon});
}
}).addTo(map);
});
</script>
</body>
</html>