Languages

Menu
Sites
Language
GPSInfoArray

I'm just tryng to get the gps info, but only get this GPSInfoArray, but I don't know how to get the data from then...

How can I stract info from this array?

 

thanks for advice.

Responses

6 Replies
Alex Ashirov

Hi,

What API do you use?

Juan Francisco Gato Luis

gps = (tizen && tizen.humanactivitymonitor)
                    || (window.webapis && window.webapis.motion) || null;

 

And then I create a handler and made the "start" ...

 

gps.start("GPS", function onSuccess(gpsInfo) {
                console.log("something change1" + gpsInfo);
            });

 

The log is : something change1[object GPSInfoArray]

But I don't know how to get info from there... its getting my this object all the time... but if I try to get .lenght or something, its send me a undefined.

Any Idea?

Juan Francisco Gato Luis

I don't know if I made the correct use of the appi, or if there are any other way to get the gps signal.

Juan Francisco Gato Luis

Making some test, I could now know that I'm making use of window.webapis.motion ...

I don't know if is the better way to works with gps ... any one has another example ?

Juan Francisco Gato Luis

I made some new test and I'm gettiong some information:

gps =  (window.webapis && window.webapis.motion) || null;

 

This get the me webapis motion, then I start the GPS:

gps.start(CONTEXT_TYPE, function onSuccess(gpsInfo) {
                console.log("something change1" + gpsInfo.gpsInfo);
                var info = gpsInfo.gpsInfo;
                console.log("caguen" + info[0].speed);
                console.log("caguen" + info[0].latitude);
                console.log("caguen" + info[0].timestamp);
                console.log("caguen" + info[0].longitude);

                handleGPSInfo(gpsInfo.gpsInfo, 'change');
            });

 

speed, latitude and longitude is getting 0, but timestamp works just finde. I think that "now" I need to get out of my house to get real values, I'm going to check it out.

Juan Francisco Gato Luis

Doesn't get real values, allways 0. Any Idea? I think that the gps is broken... cos' other samsung apps doesn't get location either...