I'm developing an application where I'm only interested in getting streets, not cities or provinces, is there a specific or recommended way to filter those?
In the meanwhile I've ended up hacking ion-google-place.js, namely the geocoder.geocode line:
geocoder.geocode(req, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
scope.$apply(function() {
var filteredResults = [];
for(i in results) {
var valid = false;
for(j in results[i].address_components) {
for(k in results[i].address_components) {
var type = results[i].address_components[j].types[k];
if( type === "route" || type === "establishment"
|| type === "point_of_interest" ) valid = true;
}
}
if(valid) filteredResults.push(results[i]);
}
scope.locations = filteredResults;
});
} else {
// @TODO: Figure out what to do when the geocoding fails
}
});
I'm developing an application where I'm only interested in getting streets, not cities or provinces, is there a specific or recommended way to filter those?
In the meanwhile I've ended up hacking ion-google-place.js, namely the geocoder.geocode line:
Thanks!