Class: MapLabeledRingLayer<T>
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:14
A map layer that displays a ring (circle) with one or more labels.
Extends
MapLayer
<T
>
Type Parameters
Type Parameter |
---|
T extends MapLayerProps <any > |
Constructors
Constructor
new MapLabeledRingLayer<
T
>(props
):MapLabeledRingLayer
<T
>
Defined in: src/sdk/components/FSComponent.ts:73
Creates an instance of a DisplayComponent.
Parameters
Parameter | Type | Description |
---|---|---|
props | T | The propertis of the component. |
Returns
MapLabeledRingLayer
<T
>
Inherited from
Properties
canvasLayerRef
protected
readonly
canvasLayerRef:NodeReference
<MapSyncedCanvasLayer
<MapLayerProps
<any
>>>
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:16
context?
optional
context: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonly
optional
contextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
isInit
protected
isInit:boolean
=false
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:27
labelContainerRef
protected
readonly
labelContainerRef:NodeReference
<HTMLDivElement
>
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:15
props
props:
T
&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
Methods
applyStrokeToContext()
protected
applyStrokeToContext(context
,lineWidth
,strokeStyle
,dash
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:232
Applies a stroke to a canvas rendering context.
Parameters
Parameter | Type | Description |
---|---|---|
context | CanvasRenderingContext2D | The canvas to which to apply a stroke. |
lineWidth | number | The stroke width. |
strokeStyle | string | CanvasPattern | CanvasGradient | The stroke style. |
dash | readonly number [] | The stroke dash. |
Returns
void
createLabel()
createLabel<
L
>(content
):null
|MapLabeledRingLabel
<L
>
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:96
Creates a ring label. Labels can only be created after this layer has been rendered.
Type Parameters
Type Parameter |
---|
L extends string | number | HTMLElement | SVGElement | DisplayComponent <any , []> |
Parameters
Parameter | Type | Description |
---|---|---|
content | VNode | The content of the new label. |
Returns
null
| MapLabeledRingLabel
<L
>
the newly created ring label, or null if a label could not be created.
destroy()
destroy():
void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:265
Destroys this component.
Returns
void
Overrides
getContext()
protected
getContext(context
):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
Parameter | Type | Description |
---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
getRingCenter()
getRingCenter():
ReadonlyFloat64Array
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:35
Gets the center position of this layer's ring, in pixels.
Returns
the center position of this layer's ring.
getRingRadius()
getRingRadius():
number
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:43
Gets the radius of this layer's ring, in pixels.
Returns
number
the radius of this layer's ring.
isRingInView()
protected
isRingInView():boolean
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:198
Checks whether this layer's ring is in view.
Returns
boolean
whether this layer's ring is in view.
isVisible()
isVisible():
boolean
Defined in: src/sdk/components/map/MapLayer.ts:38
Checks whether this layer is visible.
Returns
boolean
whether this layer is visible.
Inherited from
onAfterRender()
onAfterRender(
node
):void
Defined in: src/sdk/components/FSComponent.ts:87
A callback that is called after the component is rendered.
Parameters
Parameter | Type | Description |
---|---|---|
node | VNode | The component's VNode. |
Returns
void
Inherited from
onAttached()
onAttached():
void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:125
This method is called when this layer is attached to its parent map component.
Returns
void
Overrides
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
onDetached()
onDetached():
void
Defined in: src/sdk/components/map/MapLayer.ts:108
This method is called when this layer is detached from its parent map component.
Returns
void
Inherited from
onMapProjectionChanged()
onMapProjectionChanged(
mapProjection
,changeFlags
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:133
This method is called when the map projection changes.
Parameters
Parameter | Type | Description |
---|---|---|
mapProjection | MapProjection | this layer's map projection. |
changeFlags | number | The types of changes made to the projection. |
Returns
void
Overrides
MapLayer
.onMapProjectionChanged
onSleep()
onSleep():
void
Defined in: src/sdk/components/map/MapLayer.ts:81
This method is called when this layer's parent map is put to sleep.
Returns
void
Inherited from
onUpdated()
onUpdated(
time
,elapsed
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:143
This method is called once every map update cycle.
Parameters
Parameter | Type | Description |
---|---|---|
time | number | The current time as a UNIX timestamp. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
void
Overrides
onVisibilityChanged()
onVisibilityChanged(
isVisible
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:118
This method is called when this layer's visibility changes.
Parameters
Parameter | Type | Description |
---|---|---|
isVisible | boolean | Whether the layer is now visible. |
Returns
void
Overrides
onWake()
onWake():
void
Defined in: src/sdk/components/map/MapLayer.ts:74
This method is called when this layer's parent map is woken.
Returns
void
Inherited from
render()
render():
VNode
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:255
Renders the component.
Returns
A JSX element to be rendered.
Overrides
setRingOutlineStyles()
setRingOutlineStyles(
width?
,style?
,dash?
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:83
Sets the styling for this layer's ring outline. Any style that is not explicitly defined will be left unchanged.
Parameters
Parameter | Type | Description |
---|---|---|
width? | number | The new outline width. |
style? | string | CanvasPattern | CanvasGradient | The new outline style. |
dash? | readonly number [] | The new outline dash. |
Returns
void
setRingPosition()
setRingPosition(
center
,radius
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:52
Sets the center and radius of this layer's ring.
Parameters
Parameter | Type | Description |
---|---|---|
center | ReadonlyFloat64Array | The new center, in pixels. |
radius | number | The new radius, in pixels. |
Returns
void
setRingStrokeStyles()
setRingStrokeStyles(
width?
,style?
,dash?
):void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:69
Sets the styling for this layer's ring stroke. Any style that is not explicitly defined will be left unchanged.
Parameters
Parameter | Type | Description |
---|---|---|
width? | number | The new stroke width. |
style? | string | CanvasPattern | CanvasGradient | The new stroke style. |
dash? | readonly number [] | The new stroke dash. |
Returns
void
setVisible()
setVisible(
val
):void
Defined in: src/sdk/components/map/MapLayer.ts:46
Sets this layer's visibility.
Parameters
Parameter | Type | Description |
---|---|---|
val | boolean | Whether this layer should be visible. |
Returns
void
Inherited from
updateFromVisibility()
protected
updateFromVisibility():void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:159
Updates this layer according to its current visibility.
Returns
void
updateRingPosition()
protected
updateRingPosition():void
Defined in: src/sdk/components/map/layers/MapLabeledRingLayer.tsx:168
Updates the position of this layer's ring.
Returns
void