ReferenceError: google is not defined on using PrimeNG GMap

The PrimeNG documentation isn't great on this bit, looking at the GitHub repo helped though. Try adding the google API Script to Index.html:

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_GOES_HERE"></script>

Note that you will need to add your own api key.

Also note that I removed the defer async as when loading a page directly this was causing an error.


You need to download and use google.maps javascript library. See the documentation: https://developers.google.com/maps/documentation/javascript/tutorial

PrimeNG component is just a thin Angular wrapper for google map javascript library.