-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgps.php
More file actions
31 lines (23 loc) · 994 Bytes
/
Copy pathgps.php
File metadata and controls
31 lines (23 loc) · 994 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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iPhone 4.0 geolocation demo</title>
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"/>
<script>
function handler(location) {
var message = document.getElementById("message");
message.innerHTML ="<img src='http://maps.google.com/maps/api/staticmap?center=+AUBURN+WA+98001&zoom=14&size=400x400&sensor=false'>";
message.innerHTML+="<p>Longitude: " + location.coords.longitude + "</p>";
message.innerHTML+="<p>Accuracy: " + location.coords.accuracy + "</p>";
message.innerHTML+="<p>Latitude: " + location.coords.latitude + "</p>";
document.getElementById('longitude').innerHTML = location.coords.longitude;
document.getElementById('latitude').innerHTML = location.coords.latitude;
}
navigator.geolocation.getCurrentPosition(handler);
</script>
</head>
<body>
<div id="message">Location unknown</div>
<label id="longitude"/>
<label id="latitude"/>
</body>
</html>