0

I have a web app that uses the HTML5 geo location service, it works great except when I rolled it out to android using jasonette. Is this even possible to do?

Here is my load.jason -

 {
"$jason": {
    "head": {
        "title": "Web Container Agent"

    },
    "body": {
        "background": {
            "type": "html",
            "url": "https:mysite.com",
            "id": "app",
            "action": {
               "type": "$default"
            }
        }
    }
}

}

This is my main index page. Now I have a file called location.php which just for this purpose I will use the demo from w3 -

<script>
var x = document.getElementById("demo");

function getLocation() {
if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
} else { 
    x.innerHTML = "Geolocation is not supported by this browser.";
}
}



function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude + 
"<br>Longitude: " + position.coords.longitude;
}
</script>

Would I need to add a second json file for location.php? Or write a secondary script in the current json file to allow for this? Or is it just not possible?

Thanks!

Ryan D
  • 741
  • 1
  • 11
  • 29

1 Answers1

0

Hey this is possible but i guess mistake is with HTTPS, you might trying to get this on your local server this script will work on "https" domain only, you dont need to pass anything on this just make sure you have https domain.

Taylor Rahul
  • 709
  • 6
  • 19
  • Thanks for the quick reply, Yes these files are on my server using ssl (HTTPS), I had to remove that from the code sample as Stack wont let me post an actual link.. – Ryan D Mar 28 '18 at 18:22