O'Reilly logo

Angular UI Development with PrimeNG by Oleg Varaksin, Sudheer Jonna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Events

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required