addMarker
Adds a marker to the specified location.
Example
Usage
const marker = {
x: 0,
y: 0
};
const markerId = viewer2d.addMarker(marker);Parameters
marker
Marker to add.
Type | Required |
|---|---|
Object | Yes |
Properties
Name | Type | Required | Description |
|---|---|---|---|
clickable | Boolean | No | Marker is clickable |
color | String | No | Color of the marker, defaults to red |
data | Object | No | Optional data to associate with the marker |
draggable | Boolean | No | Marker position will change when dragged |
icon | Icon | No | Replace the default marker icon |
id | String | No | Id of the marker |
text | String | No | Optional text label displayed alongside the marker |
x | Number | Yes | X coordinate of the marker in pixels |
y | Number | Yes | Y coordinate of the marker in pixels |
Return Value
Id of the marker.
Type |
|---|
String |