Options
All
  • Public
  • Public/Protected
  • All
Menu

Package harp-datasource-protocol

@here/harp-datasource-protocol

Overview

The DataSource Protocol package contains components used for the decoding and styling of data that is used by the Datasources. This code is shared between the ui-thread and the web-workers which are used to parallelise the decoding of the data.

Techniques

This module contains interfaces for choosing techniques form the techniques catalog that are applied via the theme files to draw geometries on the map canvas.

The supported techniques that can be used to draw on the map are:

All the techniques are documented in the Techniques class' source code.

To set a technique in a theme file, you can use a technique property. See examples below.

How to Style a Map? - Overview of harp.gl's Map Styling

Techniques can be used to render map objects on the canvas in a certain way. The visual attributes of these techniques are defined and placed in the theme file.

The theme JSON file enables writing conditions which the data received from the datasource must match for a style to be applied to it. When a condition is met a set of attributes are applied to the map object is changed according to a set of predefined attributes. There is an example of a minimal theme file below. It styles the names of continents and draws a line around islands, archipelagos, cliffs and bridges.

The theme file enables to define multiple styles which are bound to the data format received from a datasource (for example a tilezen based one, check here for more information on tilezen vector tile datasource).

{
    "styles": [
        {
            "styleSet": "tilezen",
            "layer": "earth",
            "when": "kind in ['continent']",
            "technique": "text",
            "priority": ["step", ["zoom"], 0,
                2, 120,
                3, 100,
                4, 60
            ],
            "color": "#E48892",
            "fontVariant": "AllCaps",
            "opacity": 0.6
        },
        {
            "styleSet": "tilezen",
            "layer": "earth",
            "when": ["match", ["get", "kind"],
                ["archipelago", "cliff", "ridge", "island"], true,
                false
            ],
            "technique": "line",
            "color": "#C1BDB3"
        }
    ]

The conditions can be based on the datasource metadata (for example data layer like water or buildings or a specific flag like isBridge).

An example theme file used in harp-examples could be found in the berlin_tilezen_base.json. Theme file is closely connected with the type of data received from the datasource.

"technique" - determines which technique should be applied to objects fulfilling the condition

{
    "styleSet": "tilezen",
    "description": "Exemplary theme condition",
    "when": ["any",
        ["==", ["get", "kind_detail"], "pier"],
        ["==", ["get", "landuse_kind"], "pier"],
    ],
    "technique": "solid-line",
    "color": "#00f",
    "lineWidth": ["interpolate", ["linear"], ["zoom"],
        13, "1.5px",
        14, "1.2px",
        15, "0.9px"
    ]
}

Feature Selection Expressions

In the above example there is a condition used within the theme which is applying a solid-line technique to a map feature which has a kind_detail or landuse_kind property equal to pier. The line is rendered with different line widths depending on the current map zoom level.

Note that the typical logical operators like:

  • all for computing the conjunction of sub-conditions
  • any for computing the alternative of sub-conditions

"when" - is a property that holds a description of the condition. This condition queries the feature data which and uses one or many of the following operators:

  • ~= (tilde equal), returns true when the value on the left contains the value on the right, for example:
    "when": ["~=", ["get", "kind_detail"], "park"]

this condition would match kind_details like national_park_, _natural_park_, _theme_park but also parking

  • ^= (caret equal), returns true when the value on the left starts with the value on the right, for example:
    "when": ["^=", ["get", "kind_detail"], "water"]

the above condition would match kind_details like: water_park_, _water_slide or water_works but not drinking_water

  • $= (dollar equal), returns true when the value on the left ends with the value on the right, for example:
    "when": ["$=", ["get", "kind_detail"], "water"]

the above condition would match kind_details like: drinking_water but not water_park

  • == (equal equal), returns true when the value on the left is equal to the value on the right, for example:
    "layer": "roads",
    "when": ["==", ["get", "kind"], "rail"],

the above condition would match roads $layer and the kind of rail

  • != (exclamation mark equal), returns true when the value on the left is not equal to the value on the right, for example:
    "description": "All land roads except rail",
    "layer": "roads",
    "when": ["!=", ["get", "kind"], "rail"],

the above condition would match all kinds which are not rail on the roads $layer

For more in-depth details about the equality operators check the @here/harp-datasource-protocol/lib/Theme.ts.

Additionally there are two more operators available (has and in):

  • has(_variable name_) returns true when the feature contains the specified variable and it is not _undefined_, for example:
    "description": "lakes (on high zoom level show only biggest lakes)",
    "when": ["any",
        ["==", ["get", "kind"] "lake"],
        ["has", "area"],
    ]

the above condition would match all kinds which have the value lake or the area property defined.

  • in[_array of possible values_] returns true when the feature contains one of the values specified in the array, for example:
{
    "description": "Earth layer",
    "layer": "earth",
    "styleset": "tilezen",
    "when": ["in", ["get", "kind"],
        ["literal", ["archipelago",
                     "cliff",
                     "island"]]
    ],
    (...)
}

the above conditions would match all features from earth layer which kind is equal either to 'archipelago', 'cliff' or 'island'.

Where to put style changes for a certain feature or map object?

A style for a certain feature (map object) on the map is kept in the attr object. Here is an example:

    "color": "#E48892",
    "fontVariant": "AllCaps",
    "opacity": 0.6,
    "priority": ["step", ["zoom"], 0,
        2, 120,
        3, 100,
        4, 60
    ]

A list of possible style modifier for each techniques can be found in the Techniques class' source code.

Most common properties include:

  • priority: Sets a priority of a map object, defaults to 0. Objects with highest priority get placed first. Can be defined to vary depending on the zoom level with some default value. (see the example above).

  • renderOrder: which enables to define the render order of the objects created using a particular technique.

  • color: color in hexadecimal or CSS-style notation, for example: "#e4e9ec", "#fff", "rgb(255, 0, 0)", "rgba(127, 127, 127, 1.0)", or "hsl(35, 11%, 88%)".

Index

References

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

References

AmbientLight

Re-exports AmbientLight

Attachment

Re-exports Attachment

Attr

Re-exports Attr

AttributeMap

Re-exports AttributeMap

BaseLight

Re-exports BaseLight

BaseStyle

Re-exports BaseStyle

BaseTechniqueParams

Re-exports BaseTechniqueParams

BasicExtrudedLineStyle

Re-exports BasicExtrudedLineStyle

BasicExtrudedLineTechnique

Re-exports BasicExtrudedLineTechnique

BasicExtrudedLineTechniqueParams

Re-exports BasicExtrudedLineTechniqueParams

BinaryOp

Re-exports BinaryOp

BinaryOp

Re-exports BinaryOp

BooleanLiteralExpr

Re-exports BooleanLiteralExpr

BooleanLiteralExpr

Re-exports BooleanLiteralExpr

BufferAttribute

Re-exports BufferAttribute

BufferElementType

Re-exports BufferElementType

CallExpr

Re-exports CallExpr

CallExpr

Re-exports CallExpr

CaseExpr

Re-exports CaseExpr

CaseExpr

Re-exports CaseExpr

CirclesStyle

Re-exports CirclesStyle

CirclesTechnique

Re-exports CirclesTechnique

ColorUtils

Re-exports ColorUtils

CubemapSky

Re-exports CubemapSky

DataTextureProperties

Re-exports DataTextureProperties

DecodedTile

Re-exports DecodedTile

DecoderOptions

Re-exports DecoderOptions

Definition

Re-exports Definition

Definitions

Re-exports Definitions

DirectionalLight

Re-exports DirectionalLight

DynamicProperty

Re-exports DynamicProperty

Env

Re-exports Env

Env

Re-exports Env

Env

Re-exports Env

EqualityOp

Re-exports EqualityOp

EqualityOp

Re-exports EqualityOp

Expr

Re-exports Expr

Expr

Re-exports Expr

ExprDependencies

Re-exports ExprDependencies

ExprDependencies

Re-exports ExprDependencies

ExprScope

Re-exports ExprScope

ExprScope

Re-exports ExprScope

ExprVisitor

Re-exports ExprVisitor

ExprVisitor

Re-exports ExprVisitor

ExtrudedPolygonStyle

Re-exports ExtrudedPolygonStyle

ExtrudedPolygonTechnique

Re-exports ExtrudedPolygonTechnique

ExtrudedPolygonTechniqueParams

Re-exports ExtrudedPolygonTechniqueParams

Feature

Re-exports Feature

Feature

Re-exports Feature

FeatureCollection

Re-exports FeatureCollection

FeatureCollection

Re-exports FeatureCollection

FeatureDetails

Re-exports FeatureDetails

FeatureDetails

Re-exports FeatureDetails

FeatureGeometry

Re-exports FeatureGeometry

FeatureGeometry

Re-exports FeatureGeometry

FillStyle

Re-exports FillStyle

FillTechnique

Re-exports FillTechnique

FillTechniqueParams

Re-exports FillTechniqueParams

Fog

Re-exports Fog

FontCatalogConfig

Re-exports FontCatalogConfig

GeoJson

Re-exports GeoJson

GeoJson

Re-exports GeoJson

Geometry

Re-exports Geometry

GeometryCollection

Re-exports GeometryCollection

GeometryCollection

Re-exports GeometryCollection

GeometryKind

Re-exports GeometryKind

GeometryKindSet

Re-exports GeometryKindSet

GeometryType

Re-exports GeometryType

GradientSky

Re-exports GradientSky

Group

Re-exports Group

HasAttributeExpr

Re-exports HasAttributeExpr

HasAttributeExpr

Re-exports HasAttributeExpr

HeightBasedColors

Re-exports HeightBasedColors

IBloomEffect

Re-exports IBloomEffect

IMeshBuffers

Re-exports IMeshBuffers

IOutlineEffect

Re-exports IOutlineEffect

ISepiaEffect

Re-exports ISepiaEffect

ITileDecoder

Re-exports ITileDecoder

ITiler

Re-exports ITiler

IVignetteEffect

Re-exports IVignetteEffect

ImageDefinition

Re-exports ImageDefinition

ImageDefinitions

Re-exports ImageDefinitions

ImageTexture

Re-exports ImageTexture

IndexedTechnique

Re-exports IndexedTechnique

IndexedTechniqueParams

Re-exports IndexedTechniqueParams

InterleavedBufferAttribute

Re-exports InterleavedBufferAttribute

InterpolateExpr

Re-exports InterpolateExpr

InterpolateExpr

Re-exports InterpolateExpr

InterpolateMode

Re-exports InterpolateMode

InterpolateMode

Re-exports InterpolateMode

InterpolatedPropertyDefinition

Re-exports InterpolatedPropertyDefinition

InterpolationMode

Re-exports InterpolationMode

JsonArray

Re-exports JsonArray

JsonArray

Re-exports JsonArray

JsonExpr

Re-exports JsonExpr

JsonExpr

Re-exports JsonExpr

JsonExprReference

Re-exports JsonExprReference

JsonObject

Re-exports JsonObject

JsonObject

Re-exports JsonObject

JsonValue

Re-exports JsonValue

JsonValue

Re-exports JsonValue

LabelRejectionLineStyle

Re-exports LabelRejectionLineStyle

LabelRejectionLineTechnique

Re-exports LabelRejectionLineTechnique

Light

Re-exports Light

LineCaps

Re-exports LineCaps

LineDashes

Re-exports LineDashes

LineMarkerStyle

Re-exports LineMarkerStyle

LineMarkerTechnique

Re-exports LineMarkerTechnique

LineString

Re-exports LineString

LineString

Re-exports LineString

LineStyle

Re-exports LineStyle

LineTechnique

Re-exports LineTechnique

LineTechniqueParams

Re-exports LineTechniqueParams

LiteralExpr

Re-exports LiteralExpr

LiteralExpr

Re-exports LiteralExpr

LookupExpr

Re-exports LookupExpr

LookupExpr

Re-exports LookupExpr

MagFilter

Re-exports MagFilter

MakeTechniqueAttrs

Re-exports MakeTechniqueAttrs

MapEnv

Re-exports MapEnv

MapEnv

Re-exports MapEnv

MapEnv

Re-exports MapEnv

MarkerTechniqueParams

Re-exports MarkerTechniqueParams

MatchExpr

Re-exports MatchExpr

MatchExpr

Re-exports MatchExpr

MatchLabel

Re-exports MatchLabel

MatchLabel

Re-exports MatchLabel

MetricUnit

Re-exports MetricUnit

MinFilter

Re-exports MinFilter

MultiLineString

Re-exports MultiLineString

MultiLineString

Re-exports MultiLineString

MultiPoint

Re-exports MultiPoint

MultiPoint

Re-exports MultiPoint

MultiPolygon

Re-exports MultiPolygon

MultiPolygon

Re-exports MultiPolygon

NoneStyle

Re-exports NoneStyle

NullLiteralExpr

Re-exports NullLiteralExpr

NullLiteralExpr

Re-exports NullLiteralExpr

NumberLiteralExpr

Re-exports NumberLiteralExpr

NumberLiteralExpr

Re-exports NumberLiteralExpr

ObjectLiteralExpr

Re-exports ObjectLiteralExpr

ObjectLiteralExpr

Re-exports ObjectLiteralExpr

OptionsMap

Re-exports OptionsMap

PathGeometry

Re-exports PathGeometry

Pickability

Re-exports Pickability

PixelFormat

Re-exports PixelFormat

PlacementToken

Re-exports PlacementToken

PoiGeometry

Re-exports PoiGeometry

PoiStackMode

Re-exports PoiStackMode

PoiStyle

Re-exports PoiStyle

PoiTableDef

Re-exports PoiTableDef

PoiTableEntryDef

Re-exports PoiTableEntryDef

PoiTableRef

Re-exports PoiTableRef

PoiTechnique

Re-exports PoiTechnique

Point

Re-exports Point

Point

Re-exports Point

PointTechniqueParams

Re-exports PointTechniqueParams

Polygon

Re-exports Polygon

Polygon

Re-exports Polygon

PolygonalTechniqueParams

Re-exports PolygonalTechniqueParams

PostEffects

Re-exports PostEffects

RelationalOp

Re-exports RelationalOp

RelationalOp

Re-exports RelationalOp

RequestController

Re-exports RequestController

SegmentsStyle

Re-exports SegmentsStyle

SegmentsTechnique

Re-exports SegmentsTechnique

SegmentsTechniqueParams

Re-exports SegmentsTechniqueParams

ShaderStyle

Re-exports ShaderStyle

ShaderTechnique

Re-exports ShaderTechnique

ShaderTechniqueMaterialParameters

Re-exports ShaderTechniqueMaterialParameters

ShaderTechniqueParams

Re-exports ShaderTechniqueParams

Sky

Re-exports Sky

SolidLineStyle

Re-exports SolidLineStyle

SolidLineTechnique

Re-exports SolidLineTechnique

SolidLineTechniqueParams

Re-exports SolidLineTechniqueParams

SquaresStyle

Re-exports SquaresStyle

SquaresTechnique

Re-exports SquaresTechnique

StandardExtrudedLineStyle

Re-exports StandardExtrudedLineStyle

StandardExtrudedLineTechnique

Re-exports StandardExtrudedLineTechnique

StandardExtrudedLineTechniqueParams

Re-exports StandardExtrudedLineTechniqueParams

StandardGeometryKind

Re-exports StandardGeometryKind

StandardStyle

Re-exports StandardStyle

StandardTechnique

Re-exports StandardTechnique

StandardTechniqueParams

Re-exports StandardTechniqueParams

StepExpr

Re-exports StepExpr

StepExpr

Re-exports StepExpr

StringEncodedColorFormats

Re-exports StringEncodedColorFormats

StringEncodedMetricFormats

Re-exports StringEncodedMetricFormats

StringEncodedNumeralFormat

Re-exports StringEncodedNumeralFormat

StringEncodedNumeralFormatMaxSize

Re-exports StringEncodedNumeralFormatMaxSize

StringEncodedNumeralFormats

Re-exports StringEncodedNumeralFormats

StringEncodedNumeralType

Re-exports StringEncodedNumeralType

StringLiteralExpr

Re-exports StringLiteralExpr

StringLiteralExpr

Re-exports StringLiteralExpr

Style

Re-exports Style

StyleAttributes

Re-exports StyleAttributes

StyleColor

Re-exports StyleColor

StyleLength

Re-exports StyleLength

StylePriority

Re-exports StylePriority

StyleSetEvaluator

Re-exports StyleSetEvaluator

StyleSetOptions

Re-exports StyleSetOptions

Styles

Re-exports Styles

StylesDictionary

Re-exports StylesDictionary

TEXTURE_PROPERTY_KEYS

Re-exports TEXTURE_PROPERTY_KEYS

TRANSPARENCY_PROPERTY_KEYS

Re-exports TRANSPARENCY_PROPERTY_KEYS

Technique

Re-exports Technique

TerrainStyle

Re-exports TerrainStyle

TerrainTechnique

Re-exports TerrainTechnique

TerrainTechniqueParams

Re-exports TerrainTechniqueParams

TextGeometry

Re-exports TextGeometry

TextPathGeometry

Re-exports TextPathGeometry

TextStyleDefinition

Re-exports TextStyleDefinition

TextTechnique

Re-exports TextTechnique

TextTechniqueParams

Re-exports TextTechniqueParams

TextTechniqueStyle

Re-exports TextTechniqueStyle

TextureBuffer

Re-exports TextureBuffer

TextureCoordinateType

Re-exports TextureCoordinateType

TextureDataType

Re-exports TextureDataType

TextureProperties

Re-exports TextureProperties

Theme

Re-exports Theme

ThemeVisitor

Re-exports ThemeVisitor

ThreeBufferUtils

Re-exports ThreeBufferUtils

TileInfo

Re-exports TileInfo

Value

Re-exports Value

Value

Re-exports Value

Value

Re-exports Value

ValueMap

Re-exports ValueMap

ValueMap

Re-exports ValueMap

ValueMap

Re-exports ValueMap

VarExpr

Re-exports VarExpr

VarExpr

Re-exports VarExpr

VerboseDefinition

Re-exports VerboseDefinition

WorkerDecoderProtocol

Re-exports WorkerDecoderProtocol

WorkerServiceProtocol

Re-exports WorkerServiceProtocol

WorkerTilerProtocol

Re-exports WorkerTilerProtocol

WrappingMode

Re-exports WrappingMode

addBuffersToTransferList

Re-exports addBuffersToTransferList

addPolygonEdges

Re-exports addPolygonEdges

composeTechniqueTextureName

Re-exports composeTechniqueTextureName

getArrayConstructor

Re-exports getArrayConstructor

getDefinitionValue

Re-exports getDefinitionValue

getFeatureId

Re-exports getFeatureId

getFeatureName

Re-exports getFeatureName

getFeatureText

Re-exports getFeatureText

getProjection

Re-exports getProjection

getProjectionName

Re-exports getProjectionName

getPropertyValue

Re-exports getPropertyValue

getStyles

Re-exports getStyles

interpolatedPropertyDefinitionToJsonExpr

Re-exports interpolatedPropertyDefinitionToJsonExpr

isBasicExtrudedLineTechnique

Re-exports isBasicExtrudedLineTechnique

isCirclesTechnique

Re-exports isCirclesTechnique

isExtrudedLineTechnique

Re-exports isExtrudedLineTechnique

isExtrudedPolygonTechnique

Re-exports isExtrudedPolygonTechnique

isFeatureGeometry

Re-exports isFeatureGeometry

isFeatureGeometry

Re-exports isFeatureGeometry

isFillTechnique

Re-exports isFillTechnique

isInterpolatedPropertyDefinition

Re-exports isInterpolatedPropertyDefinition

isJsonExpr

Re-exports isJsonExpr

isJsonExpr

Re-exports isJsonExpr

isJsonExprReference

Re-exports isJsonExprReference

isLabelRejectionLineTechnique

Re-exports isLabelRejectionLineTechnique

isLineMarkerTechnique

Re-exports isLineMarkerTechnique

isLineTechnique

Re-exports isLineTechnique

isPoiTechnique

Re-exports isPoiTechnique

isSegmentsTechnique

Re-exports isSegmentsTechnique

isShaderTechnique

Re-exports isShaderTechnique

isSolidLineTechnique

Re-exports isSolidLineTechnique

isSpecialDashesLineTechnique

Re-exports isSpecialDashesLineTechnique

isSquaresTechnique

Re-exports isSquaresTechnique

isStandardExtrudedLineTechnique

Re-exports isStandardExtrudedLineTechnique

isStandardTechnique

Re-exports isStandardTechnique

isStylesDictionary

Re-exports isStylesDictionary

isTerrainTechnique

Re-exports isTerrainTechnique

isTextTechnique

Re-exports isTextTechnique

isTextureBuffer

Re-exports isTextureBuffer

isVerboseDefinition

Re-exports isVerboseDefinition

makeDecodedTechnique

Re-exports makeDecodedTechnique

needsVertexNormals

Re-exports needsVertexNormals

parseStringEncodedColor

Re-exports parseStringEncodedColor

parseStringEncodedNumeral

Re-exports parseStringEncodedNumeral

scaleHeight

Re-exports scaleHeight

setTechniqueRenderOrderOrPriority

Re-exports setTechniqueRenderOrderOrPriority

supportsTextures

Re-exports supportsTextures

textureCoordinateType

Re-exports textureCoordinateType

transientToPickability

Re-exports transientToPickability

Type aliases

ArrayOperatorNames

ArrayOperatorNames: keyof typeof operators

Attr

Attr<T>: {}

The attributes of a technique.

Type parameters

  • T

Type declaration

AttributeMap

AttributeMap: {} | string | number

Attributes corresponding to some decoded geometry. It may be either a map of multiple attributes or just a string with the geometry's feature id (id numbers are deprecated).

BaseStyle

BaseStyle<Technique, Params>: StyleAttributes<Technique, Params> & Partial<Params>

The object that defines what way an item of a {@link @here/harp-mapview#DataSource} should be decoded to assemble a tile.

remarks

Style is describing which features are shown on a map and in what way they are being shown.

Type parameters

  • Technique

  • Params

BasicExtrudedLineStyle

BasicExtrudedLineStyle: BaseStyle<"extruded-line", BasicExtrudedLineTechniqueParams>

BinaryOp

internal

BufferElementType

BufferElementType: "float" | "uint8" | "uint16" | "uint32" | "int8" | "int16" | "int32"

The data stored in Buffers' elements can be of the following elementary types: float, signed or unsigned integers (8-bit, 16-bit or 32-bit long).

CastOperatorNames

CastOperatorNames: keyof typeof operators

CirclesStyle

CirclesStyle: BaseStyle<"circles", PointTechniqueParams>

Render feature as set of circles rendered in screen space.

see

PointTechniqueParams.

ColorOperatorNames

ColorOperatorNames: keyof typeof operators

ComparisonOperatorNames

ComparisonOperatorNames: keyof typeof operators

Definition

Value definition commons.

DynamicProperty

DynamicProperty<T>: T | JsonExpr | InterpolatedPropertyDefinition<T>

Decorate property type with possible dynamic variants.

Type parameters

  • T

EqualityOp

EqualityOp: "~=" | "^=" | "$=" | "==" | "!="
internal

ExtrudedPolygonStyle

ExtrudedPolygonStyle: BaseStyle<"extruded-polygon", ExtrudedPolygonTechniqueParams>

Style used to draw a geometry as an extruded polygon, for example extruded buildings.

FeatureGeometry

Represents "geometry" property of "Feature" GeoJSON object.

FeatureOperatorNames

FeatureOperatorNames: keyof typeof operators

FillStyle

FillStyle: BaseStyle<"fill", FillTechniqueParams>

FlowOperatorNames

FlowOperatorNames: keyof typeof operators

GeoJson

Represents a GeoJSON object.

GeometryKind

GeometryKind: string | StandardGeometryKind

The kind of geometry is used to group objects together, allowing the group to be hidden or displayed.

remarks

Any string can be used to specify the kind of the technique in a style in the theme file. Is is suggested to specify multiple kinds for specific types of data. For a highway, the following list of kinds is suggested:

   ["line", "road", "road:highway"]

If it is a tunnel for a highway:

   ["line", "road", "road:highway", "tunnel", "road:tunnel", "road:highway:tunnel"]

If specified in this way, specific types of data (here: highway roads) can be enabled and/or disabled.

deprecated

See BaseTechniqueParams.kind.

IndexedTechnique

IndexedTechnique: Technique & IndexedTechniqueParams

For efficiency, StyleSetEvaluator returns Techniques additional params as defined in IndexedTechniqueParams.

InterpolateMode

InterpolateMode: [] | [] | [] | []

The type of the interpolation mode.

JsonArray

JsonArray: JsonValue[]

A type representing JSON arrays.

JsonExpr

JsonExpr: JsonArray

The JSON representation of an Expr object.

JsonExprReference

JsonExprReference: []

JsonValue

JsonValue: null | boolean | number | string | JsonObject | JsonArray

A type represeting JSON values.

LabelRejectionLineStyle

LabelRejectionLineStyle: BaseStyle<"label-rejection-line", BaseTechniqueParams>

Light

Possible lights used for light the map.

LineCaps

LineCaps: "Square" | "Round" | "None" | "TriangleOut" | "TriangleIn"

The style type of the line caps.

LineDashes

LineDashes: "Square" | "Round" | "Diamond"

The style type of the line dashes.

LineMarkerStyle

LineMarkerStyle: BaseStyle<"line-marker", MarkerTechniqueParams>

Render feature as line markers, which is a recurring marker along a line (usually road).

see

MarkerTechniqueParams.

LineStyle

LineStyle: BaseStyle<"line", LineTechniqueParams>

Render feature as line.

MagFilter

MagFilter: "nearest" | "linear"

Available texture magnification filters.

MakeTechniqueAttrs

MakeTechniqueAttrs<T>: {}

Make runtime representation of technique attributes from JSON-compatible typings.

Translates

  • InterpolatedPropertyDefinition -> InterpolatedProperty
  • JsonExpr -> Expr

Type parameters

  • T

Type declaration

MapOperatorNames

MapOperatorNames: keyof typeof operators

MatchLabel

MatchLabel: number | string | number[] | string[]

The labels of a MatchExpr expression.

internal

MathOperatorNames

MathOperatorNames: keyof typeof operators

MetricUnit

MetricUnit: "Meter" | "Pixel"

Defines how to interpret the units.

MinFilter

MinFilter: "nearest" | "nearestMipMapNearest" | "nearestMipMapLinear" | "linear" | "linearMipMapNearest" | "linearMipMapLinear"

Available texture minification filters.

MiscOperatorNames

MiscOperatorNames: keyof typeof operators

ObjectOperatorNames

ObjectOperatorNames: keyof typeof operators

PixelFormat

PixelFormat: "Alpha" | "RGB" | "RGBA" | "Luminance" | "LuminanceAlpha" | "RGBE" | "Depth" | "DepthStencil" | "Red"

PoiStyle

PoiStyle: BaseStyle<"labeled-icon", MarkerTechniqueParams>

Render feature as POIs (icons and text) rendered in screen space.

see

MarkerTechniqueParams.

RelationalOp

RelationalOp: "<" | ">" | "<=" | ">="
internal

SegmentsStyle

SegmentsStyle: BaseStyle<"segments", SegmentsTechniqueParams>

Render feature as segments.

ShaderStyle

ShaderStyle: BaseStyle<"shader", ShaderTechniqueParams>

Sky

Interface that defines the options to configure the sky.

SolidLineStyle

SolidLineStyle: BaseStyle<"solid-line" | "dashed-line", SolidLineTechniqueParams>

SquaresStyle

SquaresStyle: BaseStyle<"squares", PointTechniqueParams>

Render feature as set of squares rendered in screen space.

see

PointTechniqueParams.

StandardExtrudedLineStyle

StandardExtrudedLineStyle: BaseStyle<"extruded-line", StandardExtrudedLineTechniqueParams>

StandardStyle

StandardStyle: BaseStyle<"standard", StandardTechniqueParams>

StringOperatorNames

StringOperatorNames: keyof typeof operators

Style

StyleColor

StyleColor: string | number

Color literals.

remarks

Description of colors inside a style. Supports hex values as well as CSS hex, rgb and hsl values (i.e. 0xffffff, #f00fab, #aaa, rgb(255, 0 120), hsl(360, 100%, 100%), etc.).

StyleLength

StyleLength: string | number

Length literals.

remarks

Description of length units inside a style. Supports literal values (interpreted as m), m and px(i.e. 80, 14px, 0.6m, etc.).

StyleSetOptions

StyleSetOptions: Omit<DecoderOptions, "languages"> & { styleSet: Styles }

Options to be passed to the StyleSetEvaluator

Basically identical as the DecoderOptions but requires styleSet to be set.

Styles

Styles: Style[]

An array of Styles that are used together to define how a {@link @here/harp-mapview#DataSource} should be rendered.

remarks

StyleSets are applied to sources providing vector tiles via their method setStyleSet. This is also handle internally when a whole theme is passed to a {@link @here/harp-mapview#MapView} via {@link @here/harp-mapview#MapViewtheme}.

Technique

Possible techniques that can be used to draw a geometry on the map.

TerrainStyle

TerrainStyle: BaseStyle<"terrain", TerrainTechniqueParams>

TextTechniqueStyle

TextTechniqueStyle: BaseStyle<"text", TextTechniqueParams>

TextureDataType

TextureDataType: "UnsignedByte" | "Byte" | "Short" | "UnsignedShort" | "Int" | "UnsignedInt" | "Float" | "HalfFloat"

TypeOperatorNames

TypeOperatorNames: keyof typeof operators

Value

Value: null | boolean | number | string | object

The type representing the value of a property.

VectorOperatorNames

VectorOperatorNames: keyof typeof operators

WrappingMode

WrappingMode: "clamp" | "repeat" | "mirror"

Available texture wrapping modes.

Variables

Const ArrayOperators

ArrayOperators: OperatorDescriptorMap = operators

Const CastOperators

CastOperators: OperatorDescriptorMap = operators

Const ColorOperators

ColorOperators: OperatorDescriptorMap = operators

Const ComparisonOperators

ComparisonOperators: OperatorDescriptorMap = operators

Const FeatureOperators

FeatureOperators: OperatorDescriptorMap = operators

Const FlowOperators

FlowOperators: OperatorDescriptorMap = operators

Const GeometryKind

GeometryKind: StandardGeometryKind = StandardGeometryKind

Const MapOperators

MapOperators: OperatorDescriptorMap = operators

Const MathOperators

MathOperators: OperatorDescriptorMap = operators

Const MiscOperators

MiscOperators: OperatorDescriptorMap = operators

Const ObjectOperators

ObjectOperators: OperatorDescriptorMap = operators

Const StringEncodedColorFormats

StringEncodedColorFormats: StringEncodedNumeralFormat[] = [StringEncodedHex]

Array of all supported StringEncodedNumeralFormats describing color data.

internal

Const StringEncodedMetricFormats

StringEncodedMetricFormats: StringEncodedNumeralFormat[] = [StringEncodedMeters,StringEncodedPixels]

Array of all supported StringEncodedNumeralFormats describing sizes, lengths and distances.

internal

Const StringEncodedNumeralFormatMaxSize

StringEncodedNumeralFormatMaxSize: number = Math.max(StringEncodedColorFormatMaxSize,StringEncodedMetricFormatMaxSize)
internal

Const StringEncodedNumeralFormats

StringEncodedNumeralFormats: StringEncodedNumeralFormat[] = [...StringEncodedMetricFormats,...StringEncodedColorFormats]

Array of supported StringEncodedNumeralFormats (intended to be indexed with StringEncodedNumeralType enum).

internal

Const StringOperators

StringOperators: OperatorDescriptorMap = operators

Const TEXTURE_PROPERTY_KEYS

TEXTURE_PROPERTY_KEYS: string[] = ["map","normalMap","displacementMap","roughnessMap","emissiveMap","alphaMap","metalnessMap","bumpMap"]

Names of the supported texture properties.

internal

Const TRANSPARENCY_PROPERTY_KEYS

TRANSPARENCY_PROPERTY_KEYS: string[] = ["opacity", "transparent"]

Names of the properties controlling transparency.

internal

Const TypeOperators

TypeOperators: OperatorDescriptorMap = operators

Const VectorOperators

VectorOperators: OperatorDescriptorMap = operators

Functions

addBuffersToTransferList

  • addBuffersToTransferList(technique: Technique, transferList: ArrayBuffer[]): void

addPolygonEdges

  • addPolygonEdges(indexBuffer: number[], vertexOffset: number, vertexStride: number, polygonContour: number[], polygonContourEdges: boolean[], isExtruded?: undefined | false | true, addFootprintEdges?: undefined | false | true, wallEdgeSlope?: undefined | number): void
  • Fills an index buffer with the indices for the edges of a polygon contour.

    Parameters

    • indexBuffer: number[]

      Edge index buffer to be filled.

    • vertexOffset: number

      Starting offset of the vertices composing the contour.

    • vertexStride: number

      Number of elements per contour vertex.

    • polygonContour: number[]

      Vertices that compose the contour.

    • polygonContourEdges: boolean[]

      Collection of booleans indicating if contour edges should be added.

    • Optional isExtruded: undefined | false | true
    • Optional addFootprintEdges: undefined | false | true
    • Optional wallEdgeSlope: undefined | number

    Returns void

composeTechniqueTextureName

  • Compose full texture name for given image name with technique specified. Some techniques allows to add prefix/postfix to icons names specified, this function uses technique information to create fully qualified texture name.

    Parameters

    Returns string

    fully qualified texture name for loading from atlas (without extension).

evaluateTechniqueAttr

getArrayConstructor

  • getArrayConstructor(attr: BufferElementType): Float32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor
  • Returns an array with the data type specified as parameter.

    Parameters

    Returns Float32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor

getDefinitionValue

getFeatureId

  • getFeatureId(attributeMap: AttributeMap | undefined): string | number

getFeatureName

  • getFeatureName(env: Env, basePropName: string | undefined, useAbbreviation?: undefined | false | true, useIsoCode?: undefined | false | true, languages?: string[]): string | undefined
  • Determine the name of (OMV) feature. It implements the special handling required to determine the text content of a feature from its tags, which are passed in as the env.

    Parameters

    • env: Env

      Environment containing the tags from the (OMV) feature.

    • basePropName: string | undefined
    • Optional useAbbreviation: undefined | false | true

      true to use the abbreviation if available.

    • Optional useIsoCode: undefined | false | true

      true to use the tag "iso_code".

    • Optional languages: string[]

      List of languages to use, for example: Specify "en" to use the tag "name_en" as the text of the string. Order reflects priority.

    Returns string | undefined

getFeatureText

  • Determine the text string of the map feature. It implements the special handling required to determine the text content of a feature from its tags, which are passed in as the env.

    Parameters

    • context: Env | AttrEvaluationContext
    • technique: Technique

      technique defining how text should be created from feature

    • Optional languages: string[]

      List of languages to use, for example: Specify "en" to use the tag "name_en" as the text of the string. Order reflects priority.

    Returns string | undefined

getProjection

  • getProjection(projectionName: string): Projection | never

getProjectionName

  • getProjectionName(projection: Projection): string | never

getPropertyValue

  • getPropertyValue(property: Value | undefined, env: Env, cache?: Map<Expr, Value>): any

getStyles

getTechniqueAttributeDescriptor

  • getTechniqueAttributeDescriptor(technique: string | IndexedTechnique | Technique, attrName: string): AttrDescriptor | undefined

getTechniqueAutomaticAttrs

getTechniqueDescriptor

interpolatedPropertyDefinitionToJsonExpr

isBasicExtrudedLineTechnique

  • isBasicExtrudedLineTechnique(technique: Technique): technique is BasicExtrudedLineTechnique

isCirclesTechnique

  • isCirclesTechnique(technique: Technique): technique is CirclesTechnique

isExtrudedLineTechnique

  • isExtrudedLineTechnique(technique: Technique): technique is BasicExtrudedLineTechnique | StandardExtrudedLineTechnique

isExtrudedPolygonTechnique

  • isExtrudedPolygonTechnique(technique: Technique): technique is ExtrudedPolygonTechnique

isFeatureGeometry

  • isFeatureGeometry(object: any): object is FeatureGeometry

isFillTechnique

  • isFillTechnique(technique: Technique): technique is FillTechnique

isInterpolatedPropertyDefinition

  • isInterpolatedPropertyDefinition<T>(p: any): p is InterpolatedPropertyDefinition<T>

isJsonExpr

  • isJsonExpr(v: any): v is JsonExpr

isJsonExprReference

  • isJsonExprReference(value: any): value is JsonExprReference

isLabelRejectionLineTechnique

  • isLabelRejectionLineTechnique(technique: Technique): technique is LabelRejectionLineTechnique

isLineMarkerTechnique

  • isLineMarkerTechnique(technique: Technique): technique is LineMarkerTechnique

isLineTechnique

  • isLineTechnique(technique: Technique): technique is LineTechnique

isPoiTechnique

  • isPoiTechnique(technique: Technique): technique is PoiTechnique

isSegmentsTechnique

  • isSegmentsTechnique(technique: Technique): technique is SegmentsTechnique

isShaderTechnique

  • isShaderTechnique(technique: Technique): technique is ShaderTechnique

isSolidLineTechnique

  • isSolidLineTechnique(technique: Technique): technique is SolidLineTechnique

isSpecialDashesLineTechnique

  • isSpecialDashesLineTechnique(technique: Technique): technique is SolidLineTechnique
  • Type guard to check if an object is an instance of SolidLineTechnique and is a kind that has special dashes.

    note

    Lines with special dashes need line caps to render properly.

    Parameters

    Returns technique is SolidLineTechnique

isSquaresTechnique

  • isSquaresTechnique(technique: Technique): technique is SquaresTechnique

isStandardExtrudedLineTechnique

  • isStandardExtrudedLineTechnique(technique: Technique): technique is StandardExtrudedLineTechnique

isStandardTechnique

  • isStandardTechnique(technique: Technique): technique is StandardTechnique

isStylesDictionary

isTerrainTechnique

  • isTerrainTechnique(technique: Technique): technique is TerrainTechnique

isTextTechnique

  • isTextTechnique(technique: Technique): technique is TextTechnique

isTextureBuffer

  • isTextureBuffer(object: any): object is TextureBuffer

isVerboseDefinition

makeDecodedTechnique

needsVertexNormals

  • needsVertexNormals(technique: Technique): boolean

parseStringEncodedColor

  • parseStringEncodedColor(color: string): number | undefined

parseStringEncodedNumeral

  • parseStringEncodedNumeral(numeral: string, pixelToMeters?: number): number | undefined
  • Parse string encoded numeral values using all known StringEncodedNumeralFormats.

    Parameters

    • numeral: string

      The string representing numeric value.

    • Default value pixelToMeters: number = 1

      The ratio used to convert from meters to pixels (default 1.0).

    Returns number | undefined

    Number parsed or undefined if non of the numeral patterns matches the expression provided in [[numeral]].

scaleHeight

  • Determine whether to scale heights by the projection scale factor for geometry using the given technique.

    remarks

    Unless explicitly defined, the scale factor to convert meters to world space units won't be applied if the tile's level is less than a fixed storage level.

    Parameters

    • context: Env | AttrEvaluationContext

      Context for evaluation of technique attributes.

    • technique: Technique

      Technique to be evaluated.

    • tileLevel: number

      The level of the tile where the geometry is stored.

    Returns boolean

    true if height must be scaled, false otherwise.

setTechniqueRenderOrderOrPriority

supportsTextures

  • supportsTextures(technique: Technique): technique is FillTechnique | StandardTechnique | ExtrudedPolygonTechnique | TerrainTechnique

textureCoordinateType

transientToPickability

Generated using TypeDoc