Hi,
i have implemented google places autocomplete in my app.This works fine but it returns a whole load of data which i dont need. So how to extract the place name and city name .
Do Something like this
const autocomplete = new google.maps.places.Autocomplete(addressEl);
autocomplete.bindTo('bounds', this.map);
return new Observable((sub: any) => {
google.maps.event.addListener(autocomplete, 'place_changed', () => {
const place = autocomplete.getPlace();
if (!place.geometry) {
sub.error({
message: 'Autocomplete returned place with no geometry'
});
} else {
console.log('Search Lat', place.geometry.location.lat());
console.log('Search Lng', place.geometry.location.lng());
sub.next(place.geometry.location);
//sub.complete();
}
});
});
}
initializeMap() {
this.zone.run(() => {