GMap is more powerful with interactive events on the map. There are many callbacks available to hook into events while clicking on the map, overlay clicking, and dragging the overlay.

The map component example with various types of overlay events along with event callbacks would be written as follows:

<p-gmap #gmap [options]="options" [overlays]="overlaysEvents"  (onMapReady)="handleMapReady($event)"    (onMapClick)="handleMapClick($event)"       (onOverlayClick)="handleOverlayClick($event)"   (onOverlayDragStart)="handleDragStart($event)"  (onOverlayDragEnd)="handleDragEnd($event)"   [styleClass]="'dimensions'">          </p-gmap>

Either existing events can be updated by clicking the overlays or new events can be created by clicking the map using the ...

Get Angular UI Development with PrimeNG now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.