mobile/android/base/tests/robocop_geolocation.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/robocop_geolocation.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +  <title>Geolocation Test Page</title>
     1.7 +  <meta charset="utf-8">
     1.8 +</head>
     1.9 +<body>
    1.10 +<script>
    1.11 +  function clb(position) {
    1.12 +    // Show a green background if permission is granted
    1.13 +    document.body.style.background = "#008000";
    1.14 +  }
    1.15 +  function err(error) {
    1.16 +    // Show a red background if permission is denied
    1.17 +    if (error.code == error.PERMISSION_DENIED)
    1.18 +      document.body.style.background = "#FF0000";
    1.19 +  }
    1.20 +  navigator.geolocation.getCurrentPosition(clb, err, {timeout: 0});
    1.21 +</script>
    1.22 +</body>
    1.23 +</html>

mercurial