forked from Suniti13/CykaBlast-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathform.html
More file actions
63 lines (59 loc) · 2.14 KB
/
Copy pathform.html
File metadata and controls
63 lines (59 loc) · 2.14 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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action="#">
Latitude:<br>
<input id="lat" type="text" name="latitude" value="">
<br><br>
Longitude:<br>
<input id="lon" type="text" name="longitude" value="">
<br><br>
<button onclick="getLocation()">Get Location</button>
<br><br>
Depth:<br>
<input type="radio" name="depth" value="small" checked> Small
<input type="radio" name="depth" value="medium"> Medium
<input type="radio" name="depth" value="large"> large
<br><br>
Width:<br>
<input type="radio" name="width" value="small" checked> Small
<input type="radio" name="width" value="medium"> Medium
<input type="radio" name="width" value="large"> large
<br><br>
Lane:<br>
<input type="radio" name="lane" value="Left" checked> Left
<input type="radio" name="lane" value="Right"> Right
<br><br>
Fixed:<br>
<input type="radio" name="fixed" value="small" checked> Small
<input type="radio" name="fixed" value="medium"> Medium
<br><br>
<input type="file" accept="image/*" capture="camera"/>
<input type="submit" value="Submit">
<br>
</form>
<script>
var x = document.getElementById("lat");
var y = document.getElementById("lon");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
x.value=position.coords.latitude;
y.value=position.coords.longitude;
console.log(x.value,y.value)
}
</script>
</body>
</html>