Hey there, I'm currently working on using an npm package called "@types/googlemaps": "^3.30.7", but I'm facing an issue where google isn't defined when trying to implement a component for creating various items.
Despite running npm install
multiple times, the problem persists.
I have imported it as follows:
import {} from '@types/googlemaps';
and my implementation looks like this:
ngOnInit(): void {
var location = this.googleMapService.getCurrentLocation();
let mapProp = {
center: new google.maps.LatLng(this.googleMapService.currentLatitude, this.googleMapService.currentLogitude),
zoom: 15,
mapTypeId: google.maps.MapTypeId.HYBRID
};
this.map = new google.maps.Map(this.googleMap.nativeElement, mapProp);
this.map.addListener('click', (event) => this.addMarker(event));
this.addMarkerAtCurrentLocation();
}
If anyone could provide some insight on what might be causing it to be undefined, I would greatly appreciate it.