-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (43 loc) · 1.28 KB
/
index.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
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mobile tutorial - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<style>
html, body {
height: 100%;
margin: 0;
}
#map {
width: 300px;
height: 300px;
}
</style>
<style>body { padding: 0; margin: 0; } #map { height: 100%; width: 100vw; }</style>
</head>
<body>
<div id='map'></div>
<script type='text/javascript' src='https://code.jquery.com/jquery-3.5.1.min.js' />
<script type='text/javascript'>
const getGeocoding = (position) => {
console.log('geoloc');
console.log(position.coords.longitude);
console.log(position.coords.latitude);
};
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function error(err) {
console.log(err);
}
$(document).ready(function(){
console.log('ready');
navigator.geolocation.getCurrentPosition(getGeocoding, error, options);
});
</script>
</body>
</html>