{{extend 'layout.html'}}
<body >
<p id="location" >
If you see this for more than 10 seconds it means that your browser
is unable to search for your location. You can do the following to avoid
this:
<br>
1).Try switching on Location in the settings.
<br>
2).Check and fix your internet connection problem.
</p>
<div id="target">
</div>
<script>
var c=1;
var x = document.getElementById("location");
window.setInterval(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}, 5000);
function showPosition(position) {
c=c+1;
x.innerHTML =c+" " + "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude+ "<br>";
ajax('{{=URL("default","getaddress")}}' + '?latitude=' +
position.coords.latitude + '&longitude=' + position.coords.longitude
,[],'target');
}
</script>
</body>
and
{{extend 'layout.html'}}
<body >
<script>
var c=1;
var x = document.getElementById("location");
window.setInterval(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}, 5000);
function showPosition(position) {
c=c+1;
x.innerHTML =c+" " + "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude+ "<br>";
ajax('{{=URL("default","getaddress")}}' + '?latitude=' +
position.coords.latitude + '&longitude=' + position.coords.longitude
,[],'target');
}
</script>
<p id="location" >
If you see this for more than 10 seconds it means that your browser
is unable to search for your location. You can do the following to avoid
this:
<br>
1).Try switching on Location in the settings.
<br>
2).Check and fix your internet connection problem.
</p>
<div id="target">
</div>
</body>
the first one doesn't show any location at all! Why?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.