MapMarker
Neutral base marker shell for MapCanvas supporting custom content, text labels, selection, and highlighting.
Overview
MapMarker is a neutral base container widget for displaying map markers on a MapCanvas.
Key capabilities:
- Hosts arbitrary nested UI widgets or simple text labels (content, label).
- Built-in visual states for selection (selected) and target highlighting (highlighted).
- Unsurfaced transparent style by default for clean icon and label presentation.
- Governed by an underlying AnchorWidget for coordinate positioning.
Creating and Customizing Map Marker
Related links
- AnchorWidget: Spatial anchor pinning a screen-space UI widget to 3D/2D world coordinates with zoom scaling, pivot, and viewport culling.
- MapCanvas: Interactive 2D map widget extending WorldCanvas with map sizing, texture and grid layers, coordinate projection, and marker handles.
- MapMarkerHandle: Handle for fluent configuration of marker positioning, screen sizing, zoom scaling, pivot, and visibility on MapCanvas.
API
MapMarker()
Constructs an empty marker shell without default surface styling.
MapMarker(String)
Constructs a marker shell displaying a plain text label.
| Parameter | Type | Description |
|---|---|---|
text |
String |
Plain text string. |
MapMarker::anchor()
Returns the low-level AnchorWidget managing this marker positioning.
Returns AnchorWidget: The managing AnchorWidget..
MapMarker::content()
Returns the current content widget hosted inside this marker.
Returns Widget: The content widget..
MapMarker::content(Widget)
Replaces the content widget hosted inside this marker.
| Parameter | Type | Description |
|---|---|---|
content |
Widget |
Hosted content widget. |
Returns MapMarker: This instance for chaining..
MapMarker::highlighted()
Returns true if this marker is currently highlighted.
Returns boolean: True if active, enabled, or successful..
MapMarker::highlighted(boolean)
Sets the marker highlighted visual state.
| Parameter | Type | Description |
|---|---|---|
highlighted |
boolean |
Highlighted visual state flag. |
Returns MapMarker: This instance for chaining..
MapMarker::label()
Returns the hosted Label widget if content is a label, or null otherwise.
Returns Label: The Label widget instance, or null..
MapMarker::label(String)
Replaces marker content with a plain text Label widget.
| Parameter | Type | Description |
|---|---|---|
text |
String |
Plain text string. |
Returns MapMarker: This instance for chaining..
MapMarker::selected()
Returns true if this marker is currently in selected state.
Returns boolean: True if active, enabled, or successful..
MapMarker::selected(boolean)
Sets the marker selected visual state.
| Parameter | Type | Description |
|---|---|---|
selected |
boolean |
Selected visual state flag. |
Returns MapMarker: This instance for chaining..