Overlays are objects on the map that are bound to latitude/longitude coordinates or dimensions. The array of overlay instances are binding through the overlays property. Due to the nature of one-way binding, when there are changes from an array then the map will update automatically.
GMap supports various types of overlays, as shown here:
- Marker: Single locations on a map. Markers can also display custom icon images.
- Polyline: Series of straight lines on a map.
- Polygon: Series of straight lines on a map but the shape is "closed."
- Circle and rectangle: Represents a specific region as a circle/rectangle.
- Info windows: Displays content within a pop-up balloon on top of a map.
The GMap example usage with overlay options would be written as follows:
<p-gmap [options]="options" [overlays]="overlays"
[styleClass]="'dimensions'"></p-gmap>
Let's define an array of overlay instances such as markers, polyline, polygon...