I found a great js code that gives a precise GPS coordinate without using any gps sensor. In some documentations, I've learned that this is due to the usage of w3c geolocation standard.
The code is,
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
}
}
function showPosition(position) {
console.log(position.coords.latitude +
"<br>Longitude: " + position.coords.longitude);
}
It works perfect on chrome, although not in IE.
My issue is that I want to use the result of this source in my java application. Since I'm not good at javascript, I don't know what to do.
How can I retreive the result of this source?