Geolocation API

3 views
Skip to first unread message

relistan

unread,
Feb 7, 2009, 11:38:14 PM2/7/09
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

kazoomer

unread,
Feb 7, 2009, 11:46:42 PM2/7/09
to phonegap
Kari.

The new Docs/API are not implemented yet. Ive been working on it this
weekend along with 14 other things :) and we are still fine tuning
the some of the methods.
Sorry to keep you in the dark... it is coming.

Rob Ellis
Phonegap.com
Nitobi.com
Reply all
Reply to author
Forward
0 new messages