An interface describing [[THREE.Object3D]]s anchored on given {@link @here/harp-geoutils#GeoCoordinates}.
Generic material type constructor.
Type of functions used to do early rejection of elements during group state creation or update.
Any type supported by WebGLRenderingContext.texImage2D() for texture creation
Non material properties of BaseTechnique
.
Time to fade in/fade out the labels in milliseconds.
Default distance scale. Will be applied if distanceScale is not defined in the technique. Defines the scale that will be applied to labeled icons (icon and text) in the distance.
The default timeout for first message from worker.
Bitmask used for the depth pre-pass to prevent multiple fragments in the same screen position from rendering color.
Number of faces that form a SkyCubemapTexture.
Additional bounds scaling (described as percentage of full size) applied to the new labels.
This additional scaling (margin) allows to account for slight camera position and orientation changes, so new labels are placed only if there is enough space around them. Such margin limits collisions with neighboring labels while doing small camera movements and thus reduces labels flickering.
The margin applied to the text bounds of every point label.
Creates and adds a background plane mesh for the tile.
The tile to which the ground plane belongs.
The plane render order.
The plane material or a color for a default material.
The plane opacity.
Whether to create texture coordinates.
Whether the plane should receive shadows.
Whether to generate multiple LODs for sphere projection.
Apply technique base color (transparency support) to material with modifying material opacity.
the material to which color is applied
an technique the applied color comes from
{@link @here/harp-datasource-protocol#Env} instance used to evaluate {@link @here/harp-datasource-protocol#Expr} based properties of [[Technique]]
Apply technique color to material taking special care with transparent (RGBA) colors.
{@link @here/harp-datasource-protocol#Env} instance used
to evaluate {@link @here/harp-datasource-protocol#Expr}
based properties of Technique
.
Convert metric style property to expression that accounts MapView.pixelToWorld if
metricUnit === 'Pixel'
.
Builds the object associated with the given technique.
The technique.
The object's geometry.
The object's material.
The tile where the object is located.
True if elevation is enabled, false otherwise.
Applies early rejection tests for a given text element meant to avoid trying to place labels that are not visible, not ready, duplicates etc...
The Text element to check.
If TextElement is a line marker, the index into the line marker positions
The view for which the text element will be placed.
If specified, text elements farther than this max distance will be rejected.
An object with the result code and the text element view distance
( or undefined
of the checks failed) as second.
Computes distance of the specified text element to camera plane given with position and normal.
The distance is measured as projection of the vector between eyePosition
and text
onto the eyeLookAt
vector, so it actually computes the distance to plane that
contains eyePosition
and is described with eyeLookAt
as normal.
The textElement of which the view distance will be checked. It must have coordinates in world space.
If TextElement is a line marker, the index into the line marker positions.
The world eye coordinates used a reference position to calculate the distance.
The eye looking direction or simply said projection plane normal.
The text element view distance.
Creates default ClipPlanesEvaluator.
Creates material for depth prepass.
The base material of mesh that is updated to work with depth prepass and then used. This parameter is a template for depth prepass material that is returned.
depth prepass material, which is a clone of baseMaterial
with the adapted settings.
Clones a given mesh to render it in the depth prepass with another material.
original mesh
Mesh
depth pre pass
Create a specific light for lighting the map.
Create a material, depending on the rendering technique provided in the options.
The capabilities of the renderer that will use the material.
The material options the subsequent functions need.
Optional callback for each texture created for the material, getting a promise that will be resolved once the texture is loaded. Texture is not uploaded to GPU.
new material instance that matches technique.name
.
The original box to displace.
The minimum and maximum displacement values.
Direction in which the displacement will be applied.
The displaced box.
Allows to easy parse/encode technique's base color property value as number coded color.
the technique where we search for base (transparency) color value
{@link @here/harp-datasource-protocol#Env} instance
used to evaluate {@link @here/harp-datasource-protocol#Expr}
based properties of Technique
number
encoded color value (in custom #TTRRGGBB) format or undefined
if
base color property is not defined in the technique passed.
Calculates the numerical value of the technique defined color property.
the value of color property defined in technique
{@link @here/harp-datasource-protocol#Env} instance used to evaluate {@link @here/harp-datasource-protocol#Expr} based properties of [[Technique]]
Returns a [[THREE.BufferAttribute]] created from a provided {@link @here/harp-datasource-protocol#BufferAttribute} object.
BufferAttribute a WebGL compliant buffer
Compute the memory footprint of TileFeatureData
.
Returns a MaterialConstructor
basing on provided technique object.
Technique
object which the material will be based on.
Whether the material can accept shadows, this is required for some techniques to decide which material to create.
Computes the maximum view distance for text elements as a ratio of the given view's maximum far plane distance.
The view for which the maximum view distance will be calculated.
The ratio to apply to the maximum far plane distance.
Maximum view distance.
It returns an Uint8ClampedArray containing the color channel values for the given pixel coordinates. It returns undefined if the given coordinates are out of range.
Image source.
X value of the pixel.
Y value of the pixel.
HTML Canvas element on which the image is drawn.
It returns an array containing the channel colors for the pixel at the given coordinates.
X value of the pixel.
Y value of the pixel.
The image source.
Canvas element that will be used to draw the image, in case the imageData is an ImageBitmap
It returns an Uint8ClampedArray containing the color channel values for the given pixel coordinates. It returns undefined if the given coordinates are out of range.
X value of the pixel.
Y value of the pixel.
The stride value of the image data.
Calculates the world position of the supplied label. The label will be shifted if there is a specified offsetDirection and value to shift it in.
The label to shift
The projection, required to compute the correct direction offset for spherical projections.
The environment to extract the worldOffset needed to shift the icon in world space, if configured in the style.
Preallocated vector to store the result in
the [[outWorldPosition]] vector.
Initializes undefined text renderer options to default values.
The options to be initialized.
Checks if a given object is a depth prepass mesh.
The object to check whether it's a depth prepass mesh.
true
if the object is a depth prepass mesh, false
otherwise.
Helper function to check if an accessor is of type ILineAccessor
.
true
if arg
is ILineAccessor
.
Test if the TextElement this TextElementState refers to is of type LineMarker.
Text element state to test.
Helper function to check if an accessor is of type IObject3dAccessor
.
true
if arg
is IObject3dAccessor
.
Check if a given path label is too small to be rendered.
The text element to check.
Used to project coordinates from world to screen space.
Label path projected to screen space.
true
if label is too small, false
otherwise.
Check if technique requires (and not disables) use of depth prepass.
BaseStandardTechnique
instance to be checked
{@link @here/harp-datasource-protocol#Env} instance used
to evaluate {@link @here/harp-datasource-protocol#Expr}
based properties of Technique
Overlays the geometry in the given tile on top of elevation data if available. The tile's elevation may be updated with a more precise range.
The tile whose geometry will be overlaid.
Overlays a text element on top of elevation data if available.
The text element whose geometry will be overlaid.
Used to sample elevation data.
Elevation data to be sampled.
Projection from geo to world space.
Places an icon on screen.
The icon state.
Icon information necessary to compute its dimensions.
Screen position of the icon.
Scaling factor to apply to the icon dimensions.
Current map env.
Used to check the icon visibility and collisions.
PlacementResult.Ok
if icon can be placed, PlacementResult.Rejected
if there's
a collision, PlacementResult.Invisible
if it's not visible.
Places a path label along a given path on a specified text canvas.
The state of the path label to place.
The text path along which the label will be placed.
Position of the label in screen coordinates.
The text canvas where the label will be placed.
Used to check collisions with other labels.
PlacementResult.Ok
if path label can be placed, PlacementResult.Rejected
if there's
a collision or text doesn't fit into path, PlacementResult.Invisible
if it's not visible.
Place a point label text using single or multiple alternative placement anchors.
State of the point label to place.
Position of the label in screen coordinates.
Scale factor to be applied to label dimensions.
The text canvas where the label will be placed.
The {@link @here/harp-datasource-protocol#Env} used to evaluate technique attributes.
Used to check collisions with other labels.
The final label screen position after applying any offsets.
The parameter decides if multi-anchor placement algorithm should be used, be default [[false]] meaning try to place label using current alignment settings only.
PlacementResult.Ok
if point label can be placed at the base or any optional
anchor point. PlacementResult.Rejected
if there's a collision for all placements. Finally
PlacementResult.Invisible
if it's text is not visible at any placement position.
Return 'true' if the POI has been successfully prepared for rendering.
PoiInfo containing information for rendering the POI icon.
Computes distance between the given point and a plane.
May be used to measure distance of point labels to the camera projection (near) plane.
The position to measure distance to.
The position of any point on the plane.
The plane normal vector (have to be normalized already).
Adds a THREE object to the root of the tile and register [[MapObjectAdapter]].
Sets the owning tiles datasource.name and the tileKey
in the userData
property of the
object, such that the tile it belongs to can be identified during picking.
The Tile to add the object to.
The object to add to the root of the tile.
The kind of object. Can be used for filtering.
additional parameters for [[MapObjectAdapter]]
Given the x and y position in screen coordinates inside the target box, it map them to the UV coordinates.
X value in screen coordinates.
Y value in screen coordinates.
Bounding box in screen coordinates.
Uv box referred to the given bounding box.
Sets up all the needed stencil logic needed for the depth pre-pass.
Mesh created by createDepthPrePassMesh
.
Original mesh.
Returns three.js
pixel format object basing on a PixelFormat specified.
Returns three.js
texture data types based on a TextureDataType specified.
Returns three.js
wrapping mode object based on a WrappingMode specified.
Determines if a technique uses THREE.Object3D instances.
The technique to check.
true if technique uses THREE.Object3D, false otherwise.
Generated using TypeDoc
@here/harp-mapview
Overview
This module provides all the functionality needed to display a map, using most of the different modules included in this repo. The list of features include, but is not limited to: