VinylFox
14 Apr 2011, 4:20 PM
Sencha Touch version tested:
1.1
Platform tested against:
Android 2.2 (PhoneGap)
Description:
The setting used to enable high accuracy (GPS based) geolocation was changed in 0.99 release to be 'allowHighAccuracy' instead of the standardized 'enableHighAccuracy' property that is defined in the w3c spec. This typo makes it impossible to get a GPS based location update when using PhoneGap, since PhoneGap follows the specifications exactly and will not access the GPS for a location unless 'enableHighAccuracy' is set to true. The change was made in the 0.99 release (http://www.sencha.com/forum/showthread.php?102973-Sencha-Touch-Releases-amp-Notes-(1.0RC)) and has been that way ever since. The following override fixes this problem - I just made the minimal change to get it working, but you might consider fixing the name of the property as it's used in the GeoLocation configuration to match the standard 'enableHighAccuracy' property.
Fix:
Ext.override(Ext.util.GeoLocation,{
parseOptions: function(){
var ret = {
maximumAge: this.maximumAge,
enableHighAccuracy: this.allowHighAccuracy
};
//Google doesn't like Infinity
if(this.timeout !== Infinity){
ret.timeout = this.timeout;
}
return ret;
}
});
See this URL for the w3 spec: http://dev.w3.org/geo/api/spec-source.html#high-accuracy
My Git repo is all messed up right now, so I can't commit this change myself, hopefully someone else can take care of it for me.
1.1
Platform tested against:
Android 2.2 (PhoneGap)
Description:
The setting used to enable high accuracy (GPS based) geolocation was changed in 0.99 release to be 'allowHighAccuracy' instead of the standardized 'enableHighAccuracy' property that is defined in the w3c spec. This typo makes it impossible to get a GPS based location update when using PhoneGap, since PhoneGap follows the specifications exactly and will not access the GPS for a location unless 'enableHighAccuracy' is set to true. The change was made in the 0.99 release (http://www.sencha.com/forum/showthread.php?102973-Sencha-Touch-Releases-amp-Notes-(1.0RC)) and has been that way ever since. The following override fixes this problem - I just made the minimal change to get it working, but you might consider fixing the name of the property as it's used in the GeoLocation configuration to match the standard 'enableHighAccuracy' property.
Fix:
Ext.override(Ext.util.GeoLocation,{
parseOptions: function(){
var ret = {
maximumAge: this.maximumAge,
enableHighAccuracy: this.allowHighAccuracy
};
//Google doesn't like Infinity
if(this.timeout !== Infinity){
ret.timeout = this.timeout;
}
return ret;
}
});
See this URL for the w3 spec: http://dev.w3.org/geo/api/spec-source.html#high-accuracy
My Git repo is all messed up right now, so I can't commit this change myself, hopefully someone else can take care of it for me.