PDA

View Full Version : Current Location



kevinv1990
1 Dec 2010, 3:40 AM
Hey all,

I know it is possible to find the current location of the user with the Ext.Map and also with the plugin tracker of google. But now I want to use the current location (the longitude and latitude) on another place in the application, is this possible?


When i console.log my Ext.map, i find the position in it.


Object
additionalCls: Array[0]
events: Object
geo: Object
coords: P
va: 51.9126354
wa: 4.4927133
__proto__: P
events: Object
hasGeoLocation: true
highAccuracy: false
host: Object
marker: V
onError: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
onPosition: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
provider: Geolocation
trackSuspended: true
updateLocation: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
watchId: 127
__proto__: Object
id: "ext-comp-1033"
initialConfig: Object
mapOptions: Object
mons: Array[0]
plugins: Array[2]
renderData: Object
renderSelectors: Object
resumeUpdates: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
scroll: false
setHighAccuracy: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
suspendUpdates: function (){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}
traffic: Object
useCurrentLocation: true
__proto__: Object

I tried: console.log(mapdemo.geo.coords.va.Value);
but not working

Kevin

mrsunshine
1 Dec 2010, 4:05 AM
you can access the current location over the geo object, be careful this works only on you mobile device



geo.latitude
geo.longitude

kevinv1990
1 Dec 2010, 4:44 AM
thx, but i can find the position in the mappanel, it should be possible to get the value out of it right?

mrsunshine
1 Dec 2010, 4:50 AM
your map object has a property geo



map: {
map: <-- The google Map
geo: <-Ext.util.GeoLocation
}


map.geo contains the latitude and longitude if you use a mobile device

Animal
1 Dec 2010, 4:53 AM
http://dev.sencha.com/deploy/touch/docs/?class=Ext.util.GeoLocation

kevinv1990
1 Dec 2010, 4:56 AM
Thanks both of you!

GeoLocation is new in 1.0 or ?

Sorry was using 0.96 till last monday.

Greetings from Netherland