Angular Map - markers

An array of markers displayed on a map.

Type:

Array<Object>

iconSrc

A URL pointing to the custom icon to be used for the marker.

Type:

String

location

Specifies the marker location.

Type:

Object

|

String

|

Array<Number>

You can specify the location value in one of the following formats.

  • { lat: 40.749825, lng: -73.987963}
  • "40.749825, -73.987963"
  • [40.749825, -73.987963]
  • "Brooklyn Bridge,New York,NY"

If provider is "osm" and you specify markers[].location as an address string, implement providerConfig.calculateLocation to convert this address to coordinates. If the Map cannot resolve the address, the component displays the marker at {lat: 0, lng: 0}.

onClick

A callback function performed when the marker is clicked.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

Map

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

location

MapLocation

The clicked marker's coordinates.

tooltip

Popover

The clicked marker's Popover instance (only if provider is "osm").

If provider is "osm", the Map also calls this function when a user presses Enter or Space on a focused marker.

tooltip

A tooltip to be used for the marker.

Type:

String

|

Object

This property takes an object that contains text and isShown fields. The text field specifies the tooltip text. The isShown field takes a Boolean value that specifies whether a tooltip is visible by default. If the tooltip should be hidden by default, pass the tooltip text directly to the tooltip property.

If provider is "osm", the Map displays tooltips in Popover instances. To customize these instances, use the e.tooltip field in markers[].onClick.