-
Notifications
You must be signed in to change notification settings - Fork 1
/
geolocation.html
140 lines (111 loc) · 4.06 KB
/
geolocation.html
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, inital-scale=1">
<!-- stylesheet -->
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<!-- font-awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="shortcut icon" href="assets/img/fav.png">
</head>
<body>
<!-- for header -->
<div class="header">
<div class="container header-menu">
<!-- menu start -->
<div class="menu">
<nav>
<ul>
<li><a href="/index.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="#">Course</a>
<ul class="dropdown">
<li><a target="_blank" href="https://learn.zybooks.com/zybook/CUNYCSCI355TeitelmanSpring2019"> Zybook</a></li>
<li><a target="_blank" href="https://app.tophat.com/">TopHat</a></li>
<li><a target="_blank" href="https://www.onlc.com/g-suite-training-classes.htm?gclid=CjwKCAjwmtDpBRAQEiwAC6lm42Y8rDlMjDSaM8VNZmMka7wVqZaoyVisdz0hsxEsye4YDh4Z-BLBChoCTq4QAvD_BwE">Course Google Drive</a></li>
<li><a target="_blank" href="https://www.w3schools.com/">W3Schools</a></li>
</ul>
</li>
<li><a href="#">Search</a>
<ul class="dropdown">
<li><a href="fixed-list.html">Fixed List</a></li>
<li><a href="from-file.html">Form File</a></li>
<li><a href="google-api.html">Google API</a></li>
<li><a href="custom-search.html">My Search Engine</a></li>
</ul>
</li>
<li class="activemenu"><a href="#">Browse</a>
<ul class="dropdown">
<li><a href="navigator.html">Navigator</a></li>
<li><a href="window.html">Window</a></li>
<li><a href="screen.html">Screen</a></li>
<li><a href="location.html">Location</a></li>
<li><a href="geolocation.html">GeoLocation</a></li>
</ul>
</li>
<li><a href="#">About</a>
<ul class="dropdown">
<li><a href="about.html">About Develpoer</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="clearfix"></div>
<!-- end menu -->
</div>
</div>
<!-- end header -->
<!-- for navigator -->
<div class="navigator">
<div class="container">
<h3><img src="assets/img/geo_location.png" width="140px;"> Geo Location</h3>
<div id="results">
<img width="100px" src="assets/img/loader.gif">
</div>
</div>
</div>
<!-- end navigator -->
<!-- for footer -->
<div class="footer">
<div class="container">
<h3>Copyright © Nikunjan GC</h3>
</div>
</div>
<!-- end footer -->
<!-- for scripts -->
<script src="assets/js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function GeoLocation(){
this.getLocation = function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(this.showPosition);
} else {
alert("Geolocation is not supported by this browser.");
}
},
this.showPosition = function(position) {
let that = this;
let data = "<ul type='square' class='resultlist'>"+
"<li><strong>Latitude : </strong> " + position.coords.latitude+ "</li>"+
"<li><strong>Longtitude : </strong> " + position.coords.longitude + "</li>"+
"</ul>";
$("#results").empty().append(data);
},
this.init = function (){
let that = this;
setTimeout(function(){
that.getLocation();
},1000);
}
};
let obj = new GeoLocation();
obj.init();
});
</script>
</body>
</html>