-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.html
More file actions
101 lines (88 loc) · 2.73 KB
/
dev.html
File metadata and controls
101 lines (88 loc) · 2.73 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<head>
<title>Geolocation</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0px;
padding: 0px
}
#map-canvas {
height: 80%;
margin: 0px;
pading: 0px;
}
</style>
<!--
Include the maps javascript with sensor=true because this code is using a
sensor (a GPS locator) to determine the user's location.
See: https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API
-->
<script src="https://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY_GOES_HERE>&sensor=TRUE">
</script>
<script>
// Note: This example requires that you consent to location sharing when
// prompted by your browser. If you see a blank space instead of the map, this
// is probably because you have denied permission for location sharing.
var map;
function initialize() {
var mapOptions = {
zoom: 12
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var southwestCoord = new google.maps.LatLng(35.639,-78.968);
var northeastCoord = new google.maps.LatLng(35.919,-78.698);
var bounds = new google.maps.LatLngBounds(southwestCoord,northeastCoord);
var devLayer = new google.maps.KmlLayer({
url: 'http://codeforcary.org/res/sitesubplans-20140515.kml'
});
devLayer.setMap(map);
var rezLayer = new google.maps.KmlLayer({
url: 'http://codeforcary.org/res/rezoning-20140515.kml'
});
rezLayer.setMap(map);
// Try HTML5 geolocation
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
var myLocation = new google.maps.Marker({
position: pos,
map: map,
title: 'Current Location'
});
map.setCenter(pos);
}, function() {
handleNoGeolocation(true);
});
} else {
// Browser doesn't support Geolocation
handleNoGeolocation(false);
}
}
function handleNoGeolocation(errorFlag) {
if (errorFlag) {
var content = 'Error: The Geolocation service failed.';
} else {
var content = 'Error: Your browser doesn\'t support geolocation.';
}
var options = {
map: map,
position: new google.maps.LatLng(60, 105),
content: content
};
var infowindow = new google.maps.InfoWindow(options);
map.setCenter(options.position);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
<img src="/res/CodeForCaryBanner.png" /><br><center>Updated 30 MAY 2014</center>
</body>
</html>