
Untitled
By: a guest on
Jun 14th, 2012 | syntax:
JavaScript | size: 0.72 KB | hits: 16 | expires: Never
exports.getFilialen = function(type){
var url = 'https://maps.googleapis.com/maps/api/place/search/' +
'json?location=50.82718,3.26974&radius=1000&rankby=prominence&types='
+type+
'&sensor=false&key=AIzaSyDUI4VO4N8hLeTJw7cQxNqiPSQYdlySJLI';
var data;
var xhr = Ti.Network.createHTTPClient({
onload : function(e) {
data = JSON.parse( this.responseText );
for( filiaal in data ){
Ti.API.info('filiaal: ' + filiaal.results );
}
},
onerror : function(e) {
Ti.API.debug(e.error);
Ti.API.info('onerror: ' + error);
},
timeout: 5000
});
xhr.open( 'GET', url );
xhr.send();
};