# Marker

You can define map markers by using component <ymap-marker>.

Attention!

Since version 0.10 you can define markers through ymap-marker only. Map attribute placemarks not supported

Take a look,

For each marker you need to add property markerId

You can indicate marker type by using attribute marker-type. Allowable values:

  • Placemark
  • Polyline
  • Rectangle
  • Polygon
  • Circle

# Events

Event name Payload
balloonclose marker event
balloonopen
click
contextmenu
dblclick
drag
dragend
dragstart
hintclose
hintopen
mouseenter
mouseleave

Attention!

Since version 0.10 attribute callbacks not supported. You can listen component events.

# Attributes

Attribute Type Description Marker-types
marker-id String, Number Marker id. Required
marker-type String Marker type. Default: Placemark
coords Array [ latitude, longitude ] Marker's coordinates or circle center. Required Placemark, Circle
coords Array of arrays [ [latitude, longitude], [...] ] Coordinates of tops. Required Rectangle, Polyline
coords Array of two arrays of coordinates arrays (first for outer contour, second for inner) [ [[latitude, longitude], [...]], [[...], [...]] ] Coordinates of tops. Required Polygon
marker-events Array Native events, which marker emits. If not provided, marker will be emit all events, from section Events All
hint-content String Content of tip All
balloon Object Balloon properties: header, body, footer All
icon Object Marker's icon Placemark
marker-fill Object Fill properties: enabled, color, opacity, imageHref Polygon, Rectangle, Circle
marker-stroke Object Border properties: color, opacity, width, style Polygon, Rectangle, Circle, Polyline
circle-radius Number Radius of the circle in meters. Default: 1000. Circle
cluster-name String Cluster name to grouping of markers All
properties Object Marker settings (opens new window) All
options Object Marker options (opens new window) All
balloonTemplate String HTML Template for balloon All
balloon-component-props Object Props object for balloon. Use only for balloonComponent All

# Slots

You may to define balloon template through balloon slot in marker. Also you may place your custom component into this slot, but keep in mind that balloon only render view of this component and discard any logic. If you need to add some user interactive (eg handle button click), you may to listen event balloonopen and bind any handlers to your balloon elements. Don't forget to delete these handlers on balloonclose. Example Also you may define balloon layout through balloonLayout slot in marker. It's rewrite default yandex layout for balloon. Be careful, if you use balloonLayout slot, balloon slot will be ignored

# Icons

You can define settings of marker icons through fields: color (default: 'blue'), content, glyph. Property glyph has priority higher then content. List of colours and icons (opens new window). In this case you get classical view of marker.

You can also define your personal icon for marker. In this case the object of settings should be as follows:

{
  layout: 'default#image',
  imageHref: markerIcon, // address of image or data:image/svg+xml;base64
  imageSize: [43, 55], // icon size в px
  imageOffset: [-22, -55] // offset в px
}