Home > @magiclane/maps-sdk > Marker

Marker class

Marker

A compact map model representing a visual geometry (icon, point, polyline or polygon) placed at geographic coordinates for annotations, waypoints or temporary content.

Common operations include creating, managing their geometric parts and coordinates (adding, updating and removing points or parts), querying the enclosing bounds and coordinate lists for layout or hit‑testing, reading and setting basic metadata such as title and identifier.

Can be added to a MarkerCollection and displayed on the map using the MapViewMarkerCollections object associated with a GemMapController. The appearance is highly customizable using the MarkerRenderSettings and MarkerCollectionRenderSettings class.

Signature:

export declare class Marker 

Constructors

Constructor

Modifiers

Description

(constructor)(id, mapId)

Constructs a new instance of the Marker class

Properties

Property

Modifiers

Type

Description

area

readonly

RectangleGeographicArea

Get marker enclosing area.

id

readonly

number

Get marker unique id.

mapId

readonly

number

name

string

Get marker name.

partCount

readonly

number

Get marker parts count.

pointerId

readonly

number | bigint

Methods

Method

Modifiers

Description

_create(mapId)

static

_createFromCoords(coordinates)

static

add(coord, { index, part }, input)

Add a new coordinate to the marker.

delete(index, { part }, input)

Delete a coordinate from the marker.

deletePart(part)

Delete a part from marker.

deleteRange(startIndex, endIndex, params)

Delete a range of coordinates from the marker between given indexes.

deleteRange(partIndex, startIndex, endIndex)

Delete a range of coordinates from a specific part of the marker between given indexes.

dispose()

fromArea(area)

static

Create marker from a geographic area.

fromCircle(center, radius)

static

Create marker from circle with center and radius.

fromCircleRadii(params)

static

Create marker from circle with center and horizontal/vertical radii.

fromCoords(coordinates)

static

Construct from a list of coordinates.

fromRectangle(topLeft, bottomRight)

static

Create marker from rectangle with top-left and bottom-right corners.

getCoordinate(index, part)

Get coordinate from the given part, at the given index.

getCoordinates({ part }, input)

Get marker coordinates list.

getCoordinatesCount({ part }, input)

Get marker coordinates count.

getPartArea(part)

Get marker part enclosing area.

setCoordinates(coords, { part }, input)

Set marker part coordinates.

update(coord, index, { part }, input)

Update a coordinate in the marker.