I want to use the Google Maps API with my Angular project, so I used these two commands to install npm packages:
npm install @agm/core --save-dev
npm install
import { MapsAPILoader } from '@agm/core';
declare var google;
constructor(private mapsAPILoader: MapsAPILoader) {
this.mapsAPILoader.load().then(() => {
var mapProp = {
center: new google.maps.LatLng(9.93040049002793, -84.09062837772197),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
this.map = new google.maps.Map(this.gmapElement.nativeElement, mapProp);
});
}
//Hope it helps