agm in angular code example

Example: angular agm

npm install @agm/core

// on your module
import { AgmCoreModule } from '@agm/core';

imports: [
    AgmCoreModule.forRoot({
      apiKey: ''  // create a Google API Key and enable "Maps JavaScript API" for that API
    })
  ]

// on you component
  title = 'My first AGM project';
  lat = 51.678418;
  lng = 7.809007;

// on your html
<agm-map [latitude]="lat" [longitude]="lng" style="height:150px">
    <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>