Marker
Component for Managing Markers along with creating different types of markers. Every marker is a Simple2DMarker. For every marker that needs to be added, you can use the Manager to add the marker and change its look and feel. 📕 Tutorial. 📘 API.
Extends
Component
Implements
Disposable
Properties
autoCluster
autoCluster:
boolean
=true
Indicates whether markers should be automatically clustered. If true, markers will be clustered based on the threshold value. Default value is true.
enabled
enabled:
boolean
=true
OBC.Component.enabled
Overrides
OBC.Component.enabled
list
list:
Map
<string
,Map
<string
,IMarker
>>
A Map containing the markers grouped by world UUID. Each world can have its own set of markers.
onDisposed
readonly
onDisposed:Event
<unknown
>
OBC.Disposable.onDisposed
Implementation of
OBC.Disposable.onDisposed
threshold
threshold:
number
=50
The distance threshold for clustering markers. Markers within this distance will be considered for clustering. Default value is 50.
uuid
static
readonly
uuid:"4079eb91-79b0-4ede-bcf2-15b837129236"
A unique identifier for the component. This UUID is used to register the component within the Components system.
Accessors
color
get
color():string
Getter for the color property. Returns the current color of the markers.
set
color(value
):void
Setter for the color property. Updates the color of all the markers to the new value.
Parameters
Parameter | Type | Description |
---|---|---|
value | string | The new color value for the markers. |
Returns
string
The current color of the markers.
Methods
cluster()
cluster(
world
):void
Performs clustering of markers in the given world.
Parameters
Parameter | Type | Description |
---|---|---|
world | World | The world where clustering will be performed. |
Returns
void
create()
create(
world
,text
,point
,isStatic
):undefined
|string
Creates a new marker at the specified point in the world.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
world | World | undefined | The world where the marker will be created. |
text | string | undefined | The text content of the marker. |
point | Vector3 | undefined | The 3D position where the marker will be placed. |
isStatic | boolean | false | Indicates whether the marker should be static and not clustered. |
Returns
undefined
| string
The unique key of the created marker.
delete()
delete(
id
):void
Deletes a marker with the specified ID from all worlds.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the marker to be deleted. |
Returns
void
Remarks
This method iterates through all the worlds and their respective markers. If a marker with the specified ID is found, it disposes of the marker's label and removes the marker from the world's marker list.
dispose()
dispose(
type
?):void
OBC.Disposable.dispose
Parameters
Parameter | Type |
---|---|
type ? | string |