forked from maptime/anatomy-of-a-web-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet.html
48 lines (39 loc) · 1.2 KB
/
leaflet.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>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<style type="text/css">
#mapdiv { height: 100%; }
</style>
</head>
<body>
<div id="mapdiv"></div>
<script>
var geojsonFeature = {
"type": "Feature",
"properties": {
"name": "PARISOMA"
},
"geometry": {
"type": "Point",
"coordinates": [-122.41598, 37.77349]
}
};
var mapvar = L.map('mapdiv').setView([37.7706,-122.3782],12);
var tileLayer = L.tileLayer(
'http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.jpg',
{
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under CC BY 3.0. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under CC BY SA.'
}
);
mapvar.addLayer(tileLayer);
var geojsonLayer = L.geoJson(
geojsonFeature,
{
onEachFeature: function(feature, layer) { layer.bindPopup(feature.properties.name); }
}
);
mapvar.addLayer(geojsonLayer);
</script>
</body>
</html>