I'm working on a project on Sencha Touch and NodeJS.
What I am trying to do now is get the device's moving speed. From what I have seen in Sencha Docs I'm supposed to use Ext.device.Geolocation in order to use the device's geolocation services instead of the browser's.
Here's the way I'm doing it...
Ext.device.Geolocation.getCurrentPosition({
success: function(position) {
alert(position.coords.speed);
alert(JSON.stringify(position))
},
failure: function() {
console.log('something went wrong!');
}
});
The position var in there gets this value when running from my iPhone..
{ busId: '186', position:'{"speed":null,"accuracy":81.15007979037921,
"altitudeAccuracy":10,"altitude":9.457816123962402,"longitude":-54.950113117326524,
"heading":null,"latitude":-34.93604986481545}'}
Which is missing the speed property, and I can't figure out why.
An even stranger thing happens though. If I access my app through an Android device, the position variable is empty. All I get is {}
.
The app is running on localhost on my PC, and when I say access through my phone I mean I access to it with my PCs IP. I don't know if that is supposed to work ok or not though.
I have added the Cordova API, or tried to, in my projects folder, like this...
And included in my index.html like this...
<script type="text/javascript" src="./cordova-ios/CordovaLib/cordova.js"></script>
I have zero experience with Cordova so I have no idea what I'm doing here, what am I doing wrong?