-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.html
More file actions
74 lines (55 loc) · 1.87 KB
/
Copy pathdev.html
File metadata and controls
74 lines (55 loc) · 1.87 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>Development in Cary, NC</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css" />
<script src="http://leafletjs.com/dist/leaflet.js"></script>
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map');
var southwestCoord = L.latLng(35.639,-78.968);
var northeastCoord = L.latLng(35.919,-78.698);
var bounds = L.latLngBounds(southwestCoord, northeastCoord);
L.tileLayer('http://{s}.tile.cloudmade.com/f384e4d989e547aeae6e0ce04a9aa2e0/997/256/{z}/{x}/{y}.png', {
minZoom: 12,
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
}).addTo(map);
map.setMaxBounds(bounds);
var legend = L.control({position: 'bottomright'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
div.innterHTML = '<h1>February 2014<h1>';
return div;
};
legend.addTo(map);
function onLocationFound(e) {
var radius = e.accuracy / 2;
var currSpd = e.speed;
L.marker(e.latlng).addTo(map)
.bindPopup("Current Location (within " + radius + " meters from this point) at " + currSpd + ".").openPopup();
L.circle(e.latlng, radius).addTo(map);
}
function onLocationError(e) {
alert(e.message);
}
map.on('locationfound', onLocationFound);
map.on('locationerror', onLocationError);
map.locate({setView: true, maxZoom: 16});
</script>
<!-- Sourcing the polygons and putting them on the map -->
<script src="js/polyCoords.js"></script>
</body>
</html>