Class MapNodeAbstract

Represents a map tile node inside of the tiles quad-tree

Each map node can be subdivided into other nodes.

It is intended to be used as a base class for other map node implementations.

Hierarchy (view full)

Constructors

  • Parameters

    • parentNode: MapNode = null
    • mapView: MapView = null
    • location: number = QuadTreePosition.root
    • level: number = 0
    • x: number = 0
    • y: number = 0
    • geometry: BufferGeometry<NormalBufferAttributes> = null
    • material: Material = null

    Returns MapNode

Properties

childrenCache: Object3D<Object3DEventMap>[] = null

Cache with the children objects created from subdivision.

Used to avoid recreate object after simplification and subdivision.

The default value is null. Only used if "cacheTiles" is set to true.

disposed: boolean = false

Flag to indicate if the map node was disposed.

When a map node is disposed its resources are dealocated to save memory.

isMesh: true = true

Flag to check if the node is a mesh by the renderer.

Used to toggle the visibility of the node. The renderer skips the node rendering if this is set false.

level: number

Tile level of this node.

location: number

Index of the map node in the quad-tree parent node.

Position in the tree parent, can be topLeft, topRight, bottomLeft or bottomRight.

mapView: MapView = null

The map view object where the node is placed.

nodesLoaded: number = 0

Indicates how many children nodes are loaded.

The child on become visible once all of them are loaded.

parentNode: MapNode = null

Parent node (from an upper tile level).

subdivided: boolean = false

Variable to check if the node is subdivided.

To avoid bad visibility changes on node load.

x: number

Tile x position.

y: number

Tile y position.

baseGeometry: BufferGeometry<NormalBufferAttributes> = null

Base geometry is attached to the map viewer object.

It should have the full size of the world so that operations over the MapView bounding box/sphere work correctly.

childrens: number = 4

How many children each branch of the tree has.

For a quad-tree this value is 4.

defaultTexture: Texture = ...

Default texture used when texture fails to load.

defaultTransparentTexture: Texture = ...

Methods

  • Create the child nodes to represent the next tree level.

    These nodes should be added to the object, and their transformations matrix should be updated.

    Returns void

  • Dispose the map node and its resources.

    Should cancel all pending processing for the node.

    Returns void

  • Initialize resources that require access to data from the MapView.

    Called automatically by the constructor for child nodes and MapView when a root node is attached to it.

    Returns Promise<void>

  • Load tile texture from the server.

    This base method assumes the existence of a material attribute with a map texture.

    Returns Promise<void>

  • Increment the child loaded counter.

    Should be called after a map node is ready for display.

    Returns void

  • Simplify node, remove all children from node, store them in cache.

    Reset the subdivided flag and restore the visibility.

    This base method assumes that the node implementation is based off Mesh and that the isMesh property is used to toggle visibility.

    Returns void

  • Subdivide node,check the maximum depth allowed for the tile provider.

    Uses the createChildNodes() method to actually create the child nodes that represent the next tree level.

    Returns void