/content/guides/simstad/simstad.png

Marker

Contributors

mange61
guser40

Funding

formas
smartbuilt

Marker

A marker is a small circle that can be moved around the map. This is used as a laser pointer when the user touches the map on the interface. It can also be used as spotlights to highlight points of interest.

Markers are added using SetMapLightRequest and removed using RemoveMapMarkerRequest. When a marker is added or removed, Unreal responds with MapMarkerResponse, providing a list of all active markers.

SetMapLightRequest

Creates a new marker with a given id. When a new id is set, a new marker is added and any further calls will update its properties. To minimize the amount of data sent, set all properties on the first call, and only send required properties onwards.

nametyperequireddefaultdescription
typestring"SetMapMarkerRequest"
idstringId of marker
unumberX coordinate relative to map (0 – 1)
vnumberY coordinate relative to map (0 – 1)
radiusnumber0.05Radius relative to map size (0 – 1)
colorstring"#FFFFFF"Hex color code
emissionnumber0If 0, affected by lighting; if 1–, emit light
opacitynumber11 = opaque, 0 = transparent
densitynumber100100 = full circle, 1 = soft fade

Example request:

{
  "type": "SetMapMarkerRequest",
  "id": "marker_1",
  "u": 0.5,
  "v": 0.5,
  "radius": 0.05,
  "color": "#FF0000",
}

RemoveMapMarkerRequest

Removes a marker with a given id.

nametyperequireddescription
typestring"RemoveMapMarkerRequest"
idstringId of marker

Example request:

{
  "type": "RemoveMapMarkerRequest",
  "id": "marker_1",
}

MapMarkerResponse

Upon adding or removing a marker, Unreal responds with a list of currently active marker ids.

nametypedescription
typestring"MapMarkerResponse"
idstring[]List of active marker ids

Example response:

{
  "type": "MapMarkerResponse",
  "ids": ["marker_1", "marker_2", ...]
}