PDA

View Full Version : get variable from function



myput
27 Oct 2011, 8:05 AM
Hello, i have a google map card, and i would like to set longitude and latitude by a function because i need dynamic variable from a store, i can get this variable in the map panel .... but in a function ...

like this:



WPApp.views.CarteButton = Ext.extend(Ext.Panel,{
coords: [45.935, 6.632],
mapText: '',
permLink: '',
initMap: function(data) {
this.pos = new google.maps.LatLng(data.latitude, data.longitude);
},
initComponent: function() {
var position = new google.maps.LatLng(this.coords[0], this.coords[1]);

.......


In initMap, pos is good with good variables from the store.
But i would like to set coords or directly in initComponent with pos variable ....

I don't know how i can do .
Help please :)

myput
28 Oct 2011, 5:52 AM
up

Bunchofstring
28 Oct 2011, 9:00 AM
I do not understand what your goal is, but maybe this will help.
http://docs.sencha.com/touch/1-1/#!/api/Ext.Map

myput
28 Oct 2011, 9:04 AM
thanks :) but it's not only for a map. in fact, i have a list with a store who get some variables from a store, a normal list, after in my detailPanel, when i click, i have a map, but i would like my map takes longitudes and latitude from my store ...

I can display the variable with a tpl or in html, but i can't get the variable and use in a function map ... or initComponent ... that's crazy