Yeah sure:
Code:
function callbackFunction(response) {
if(!response)
alert("NO RESULT");
else
alert("GEOCODE OK");
}
nokia.Settings.set("appId", "--------------------------");
nokia.Settings.set("authenticationToken", "---------------------------");
var searchManager = nokia.places.search.manager;
// init timeout function
var searchTimeout = setTimeout(function() {
callbackFunction(false);
}, 3000);
searchManager.geoCode({
searchTerm: searchTerm,
onComplete: function(responseData, status) {
clearTimeout(searchTimeout);
if(status == "OK") {
callbackFunction(responseData);
} else {
callbackFunction(false);
}
}
});
The callback function is the one which will called if geocode was sucessfull OR if the timeout was over.
If the geocode come into onComplete i stop the timeout function and proceed.
I hope this helps you ;)