bweiler
22 Apr 2011, 4:17 PM
I'm running into a strange problem accessing the Ext.util.GeoLocation (http://hwl2y21/dev/iphone/proj/voter/Sencha/touch/docs/source/GeoLocation.html#cls-Ext.util.GeoLocation) coordinates. The latitude and longitude are undefined and the coordinates appear to be nested indefinitely.
Has anyone run into this and found a workaround?
Thanks
MyApp.views.MapView = Ext.extend(Ext.Panel, {
id: 'mapView',
initComponent: function() {
Ext.apply(this, {
layout: 'fit',
dockedItems: [this.getToolbar()],
items: [this.getMap()]
});
MyApp.views.MapView.superclass.initComponent.apply(this, arguments);
},
getMap: function() {
this.mapPanel = new Ext.Map({
itemId: 'mapPanel',
useCurrentLocation: true
});
return this.mapPanel;
},
getToolbar: function() {
...
}
}
Ext.reg('mapview', MyApp.views.MapView);
Ext.regController("mapController", {
showMap: function(list, record) {
this.mapView = this.render({
xtype: 'mapview'
});
this.mapPanel = this.mapView.getComponent('mapPanel');
console.log("mapPanel", this.mapPanel);
}
});
Expanded object from console.log("mapPanel", this.mapPanel);
mapPanel Object
additionalCls: Array (0)
cancelAutoSize: true
componentCls: "x-map"
componentLayout: Object
container: Object
el: Object
events: Object
geo: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
...
Has anyone run into this and found a workaround?
Thanks
MyApp.views.MapView = Ext.extend(Ext.Panel, {
id: 'mapView',
initComponent: function() {
Ext.apply(this, {
layout: 'fit',
dockedItems: [this.getToolbar()],
items: [this.getMap()]
});
MyApp.views.MapView.superclass.initComponent.apply(this, arguments);
},
getMap: function() {
this.mapPanel = new Ext.Map({
itemId: 'mapPanel',
useCurrentLocation: true
});
return this.mapPanel;
},
getToolbar: function() {
...
}
}
Ext.reg('mapview', MyApp.views.MapView);
Ext.regController("mapController", {
showMap: function(list, record) {
this.mapView = this.render({
xtype: 'mapview'
});
this.mapPanel = this.mapView.getComponent('mapPanel');
console.log("mapPanel", this.mapPanel);
}
});
Expanded object from console.log("mapPanel", this.mapPanel);
mapPanel Object
additionalCls: Array (0)
cancelAutoSize: true
componentCls: "x-map"
componentLayout: Object
container: Object
el: Object
events: Object
geo: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
autoLoad: false
coords: Object
...