First, sorry for my english. I'm developing an Android App using phonegap. I'm using html with css, js, and json hosted to the server.
I have a .json data that contains latitude and altitude data. The .json data displayed on html as lists. And then i want when i open the html, it will detect my current location using geolocation and then automatically measure distance between my current location and all of my .json data in kilometres
Which one i have to use and how to do that. Determine my position from GPS (phonegap) or with html geolocation? and then show the distance from my current position with my json data (altitude and longitude)
This my json data (i'm using json2html transform)
// Geo - i got that numbers from google maps
var content = [{
"geo-00":"geo:40.948823, -74.066191?q=40.948823, -74.066191?z=17",
"geo-01":"geo:40.930027, -74.105579?q=40.930027, -74.105579?z=17",
"geo-02":"geo:40.966902, -74.078574?q=40.966902, -74.078574?z=17",
}];
// List
var rules = [
{"tag":"a","href":"${geo-00}","class":"loc-link"},
{"tag":"a","href":"${geo-01}","class":"loc-link"},
{"tag":"a","href":"${geo-02}","class":"loc-link"},
];
// JS Write
var page = json2html.transform(content,rules);document.write(''+page+'');