-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapexample.html
More file actions
35 lines (32 loc) · 1009 Bytes
/
Copy pathmapexample.html
File metadata and controls
35 lines (32 loc) · 1009 Bytes
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
<!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:100%; height:800px"></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 = 'custom.geo.json';
var myCustomStyle = {
stroke: false,
fill: true,
fillColor: '#fff',
fillOpacity: 1
}
$.getJSON(myGeoJSONPath,function(data){
var map = L.map('map').setView([15.326572, -76.157227], 1.5);
L.geoJson(data, {
clickable: true,
style: myCustomStyle
}).addTo(map);
})
</script>
</body>
</html>