I have work on the project on Ionic 2 and I have implemented the map so far, but I can not get out of that point. I needed to be shown the way I should go in order to add Go
Use elementref for accessing the ion input used instead of document.getElementById
Try:
In your component class,
import {Elementref } from '@angular/core';
@ViewChild("places")
public places: ElementRef;
InitMap(){
this.setLocation();
let autocomplete = new google.maps.places.Autocomplete(this.places.nativeElement);
google.maps.event.addListener(autocomplete, 'place_changed', () => {
let place = autocomplete.getPlace();
this.latitude = place.geometry.location.lat();
this.longitude = place.geometry.location.lng();
alert(this.latitude + ", " + this.longitude);
console.log(place);
});
}
Check angular docs here