Forum /
Sencha Touch 2.x Forums /
Sencha Touch 2.x: Q&A /
Unanswered: iOS GeoLocation problems...
Unanswered: iOS GeoLocation problems...
Hi all,
Have a problem with geolocation. Works fine on Chrome/Android but on iOS it works intermittently. It works sometimes and then nothing. The little arrow appears to say it is using GeoLocation but it does not find my location at all. Code below... Any assistance appreciated.
this.app.geo = Ext.create('Ext.util.Geolocation', {
autoUpdate: false,
accuracy :1,
scope: this,
listeners: {
locationupdate: function(geo) {me.geoUpdate.call(me,geo)},
locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {me.geoUpdate.call(me,geo, bTimeout, bPermissionDenied, bLocationUnavailable, message)}
}
});
this.app.geo.updateLocation();
geoUpdate: function(geo){
if(this.view) {
var lat = geo._latitude;
var lng = geo._longitude;
currentLocation = new google.maps.LatLng(lat, lng);
this.map.setMapCenter(currentLocation);
this.mapMoved();
}
},
getError: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message){
console.log('getError',geo, bTimeout, bPermissionDenied, bLocationUnavailable, message);
},
=============== From the voiew being used ===============
xtype: 'map',
cls: 'map',
itemId: 'personalMap',
useCurrentLocation: false,
mapOptions: {
center: new google.maps.LatLng(51.507335, -0.127683),
zoom: 16,
disableDefaultUI: true,
streetViewControl: false
},
listeners: {
maprender: {
single: true,
scope: this,
fn: function(map, gmap) {
CabFix.app.getController('PersonalMap').mapRendered(map, gmap);
}
}
}
It is an iOS6 bug. Initial call works fine, all subsequent ones crash!
Thanks....
Thanks....
I do not know for certain but I thought I was having the same problem with iOS5....
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us