跳到主要内容

flywave-mapview.textelementsrenderer

Home > @flywave/flywave-mapview > TextElementsRenderer

TextElementsRenderer class

Internal class to manage all text rendering.

Signature:

export declare class TextElementsRenderer 

Constructors

Constructor

Modifiers

Description

(constructor)(m_viewState, m_screenProjector, m_poiManager, m_renderer, m_imageCaches, options, textCanvasFactory, poiRenderer, screenCollisions)

Create the TextElementsRenderer which selects which labels should be placed on screen as a preprocessing step, which is not done every frame, and also renders the placed s every frame.

Properties

Property

Modifiers

Type

Description

delayLabelsUntilMovementFinished

boolean

disableFading

boolean

isUpdatePending

readonly

boolean

true if TextElements are not placed finally but are still updating, including fading or waiting for elevation.

loading

readonly

boolean

true if any resource used by any FontCatalog is still loading.

overlayText

readonly

TextElement[] | undefined

overloaded

readonly

boolean

Is true if number of s in visible tiles is larger than the recommended number OVERLOAD_LABEL_LIMIT.

showReplacementGlyphs

boolean

If true, a replacement glyph ("?") is rendered for every missing glyph.

styleCache

readonly

TextStyleCache

Methods

Method

Modifiers

Description

addOverlayText(textElements)

Adds new overlay text elements to this MapView.

clearOverlayText()

Adds new overlay text elements to this MapView.

clearRenderStates()

Reset the current text render states of all visible tiles.

getMemoryUsage()

Return memory used by all objects managed by TextElementsRenderer.

hasOverlayText()

invalidateCache()

Forces update of text elements in the next call to [[placeText]].

movementFinished()

Notify TextElementsRenderer that the camera has finished its movement.

movementStarted()

Notify TextElementsRenderer that the camera has started a movement.

pickTextElements(screenPosition, pickListener)

Fill the picking results for the pixel with the given screen coordinate. If multiple s are found, the order of the results is unspecified.

Note: s with identical featureId or identical userData will only appear once in the list pickResults.

placeText(dataSourceTileList, time)

Places text elements for the current frame.

renderText(farPlane)

Render the text using the specified camera into the current canvas.

restoreRenderers(renderer)

updateCamera()

updateFontCatalogs(fontCatalogs)

Updates the FontCatalogs used by this TextElementsRenderer.

updateTextStyles(textStyles, defaultTextStyle)

waitLoaded()

Waits till all pending resources from any FontCatalog are loaded.