...
An example javascript of using Geolocation API is as follows:<script>
| Code Block |
|---|
<script> navigator.geolocation.getCurrentPosition( |
...
function(position) |
...
{ alert(position.coords.latitude); |
...
alert(position.coords.longitude); |
...
}, function(){ |
...
// |
...
error }); |
...
</script> |
The javascript will show the location of device on a screen. To enable geolocation in an application using the WebView class, the following permission and the use of WebView class is necessary:
...