relistan
unread,Feb 7, 2009, 11:38:14 PM2/7/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
There is documentation for the Geolocation API but currently I don't
seem to be able to get it to do anything. The, what I think must be,
older Device.Location.* seems to retrieve information though the
callback only fires the first time init() is called. Can someone post
a snippet of code that uses the newer API? Or that uses the older one
and gets the location more than once? I can't find any examples.
Here's what I'm calling and would expect to work:
var success = function(pos) {
document.getElementById('status').innerHTML = "lat: " + pos.latitude
+ " lon: " + pos.longitude;
}
var failure = function() {
document.getElementById('status').innerHTML = 'failure';
}
navigator.geolocation.getCurrentPosition(success, failure, {});
No response comes from this at all. What am I doing wrong?
Help appreciated!
Cheers,
Karl