Build a Angular Google Maps API Project to Embed Maps With Markers & Info Windows Using @AGM/CORE

 

npm i @agm/core

 

Directory Structure

 

 

 

Now modify the app.module.ts to register the package and replace your own api_key from google cloud console

 

app.module.ts

 

 

Now modify the template file and copy below the following code

 

app.component.html

 

 

Now you need to add the code inside the app.component.ts file as shown below

 

app.component.ts

 

 

Now add the css code inside the app.component.css file as shown below

 

app.component.css

 

 

Running the App

 

Now to run the app we can start the angular app as shown below

 

ng serve

 

 

 

FULL SOURCE CODE

 

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *