Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PoiRenderer

internal

Manage POI rendering. Uses a PoiBatchRegistry to actually create the geometry that is being rendered.

Hierarchy

  • PoiRenderer

Index

Constructors

constructor

Accessors

layers

renderer

  • get renderer(): WebGLRenderer

Methods

addLayer

addPoi

  • addPoi(poiInfo: PoiInfo, screenPosition: Vector2, screenCollisions: ScreenCollisions, viewDistance: number, scale: number, allocateScreenSpace: boolean, opacity: number, env: Env): void
  • Add the icon. Icon will only be added if opacity > 0, otherwise only its space will be allocated.

    Parameters

    • poiInfo: PoiInfo

      PoiInfo containing information for rendering the POI icon.

    • screenPosition: Vector2

      Position on screen (2D):

    • screenCollisions: ScreenCollisions

      Object handling the collision checks for screen-aligned 2D boxes.

    • viewDistance: number

      Box's distance to camera.

    • scale: number

      Scaling factor to apply to text and icon.

    • allocateScreenSpace: boolean

      If true screen space will be allocated for the icon.

    • opacity: number

      Opacity of icon to allow fade in/out.

    • env: Env

    Returns void

    • true if icon has been actually rendered, false otherwise.

getMemoryUsage

pickTextElements

  • pickTextElements(screenPosition: Vector2, pickCallback: (pickData: any | undefined) => void): void
  • Fill the picking results for the pixel with the given screen coordinate. If multiple PoiInfos are found, the order of the results is unspecified.

    Parameters

    • screenPosition: Vector2

      Screen coordinate of picking position.

    • pickCallback: (pickData: any | undefined) => void

      Callback to be called for every picked element.

        • (pickData: any | undefined): void
        • Parameters

          • pickData: any | undefined

          Returns void

    Returns void

prepareRender

  • Prepare the POI for rendering, and determine which PoiBuffer should be used. If a PoiBuffer is assigned, the POI is ready to be rendered.

    Parameters

    • pointLabel: TextElement

      TextElement with PoiInfo for rendering the POI icon.

    • env: Env

      TODO! The current zoomLevel level of MapView

    Returns boolean

    True if the space is not already allocated by another object (text label or POI)

render

  • render(camera: OrthographicCamera, layer: PoiLayer): void

reset

  • reset(): void

update

  • update(): void

Static computeIconScreenBox

  • computeIconScreenBox(poiInfo: PoiInfo, screenPosition: Vector2, scale: number, env: Env, screenBox?: Box): Box
  • Compute screen box for icon. It is required that prepareRender has been successfully called before computeScreenBox may be called.

    Parameters

    • poiInfo: PoiInfo

      PoiInfo containing information for rendering the POI icon.

    • screenPosition: Vector2

      Position on screen (2D).

    • scale: number

      Scale to apply to icon.

    • env: Env

      Current zoom level.

    • Default value screenBox: Box = new Math2D.Box()

      Box that will be used to store the result.

    Returns Box

    The computed screen box for the icon.

Generated using TypeDoc