-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyPosition.html
98 lines (86 loc) · 2.55 KB
/
myPosition.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
<html>
<head>
<title>My Position</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="https://rawgithub.com/HPNeo/gmaps/master/gmaps.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="http://www.amazium.co.uk/includes/base.css">
<link rel="stylesheet" href="http://www.amazium.co.uk/includes/amazium.css">
<link rel="stylesheet" href="http://www.amazium.co.uk/includes/layout.css">
<script type="text/javascript">
var map, location, test;
$(document).ready(function(){
$("#mylat").hide();
$("#contenedor").hide();
$("#mylon").hide();
map = new GMaps({
div: '#map',
lat: 0,
lng: 0,
zoom: 2,
click: function (f) {
test = f;
location = map.addMarker({
lat: f.latLng.jb,
lng: f.latLng.kb,
title: 'Lima',
click: function(e) {
console.log("test");
test = e;
}
});
}
});
GMaps.geolocate({
success: function(position) {
map.setCenter(position.coords.latitude, position.coords.longitude);
map.addMarker({
lat: position.coords.latitude,
lng: position.coords.longitude,
title: 'You',
});
map.setZoom(18);
$("#contenedor").show();
$("#mylat").show().append(position.coords.latitude);
$("#mylon").show().append(position.coords.longitude);
},
error: function(error) {
alert('Geolocation failed: '+error.message);
},
not_supported: function() {
alert("Your browser does not support geolocation");
},
});
});
</script>
</head>
<body>
<div class="row">
<div class="grid_12 offset_5">
<h1>What is my Position</h1>
</div>
</div>
<div class="row">
<div id="map" class="grid_12" style="height:400px;">
</div>
</div>
<div class="row">
<div id="contenedor" class="grid_12">
<div class="row">
<h3 class="grid_5 offset_2" id="mylat"><b>Your latitud is:</b> </h3>
</div>
<div class="row">
<h3 class="grid_5" id="mylon"><b>Your longitud is:</b> </h3>
</div>
</div>
</div>
</body>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43222035-1', 'toolsdevweb.com');
ga('send', 'pageview');
</script>
</html>