Ciao a tutti!
Ho creato una classe (con prototype) che durante l'inizializzazzione esegue l'istruzione GEvent.bind (API Google).
GEvent.bind chiama la funzione "goodresult" che assegna a this._add (parametro della mia classe) l'indirizzo calcolato.
La funzione "getAddress" ritorna il parametro privato "add".
Il mio problema è che la funzione "goodresult" non assegna a this._add il valore. Probabilemte è un problema legato al binding.
codice:
//[...]
this._add = "";
//[...]
GEvent.bind(this._rg, "load", this, this._goodresult);
//[...]
codice:
_goodresult: function(placemark) {
this._add = placemark.address + '
' + 'Country code: ' + placemark.AddressDetails.Country.CountryNameCode;
},
codice:
getAddress: function() {
return this._add;
},
Cosa dovrei fare per assegnare correttamente il valore a this._add?
Grazie!