-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
39 lines (34 loc) · 1.02 KB
/
map.html
File metadata and controls
39 lines (34 loc) · 1.02 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Leaflet GeoJSON Example</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.css" />
<style type="text/css">
.leaflet-container {
background-color: #c5e8ff;
}
</style>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js"></script>
<script>
var myGeoJSONPath = 'path/to/mymap.geo.json';
var myCustomStyle = {
stroke: false,
fill: true,
fillColor: '#fff',
fillOpacity: 1
}
$.getJSON(myGeoJSONPath, function (data) {
var map = L.map('map').setView([39.74739, -105], 4);
L.geoJson(data, {
clickable: false,
style: myCustomStyle
}).addTo(map);
})
</script>
</body>
</html>