Interface MapViewOptions

User configuration for the MapView.

Hierarchy

  • TextElementsRendererOptions
  • Partial<LookAtParams>
    • MapViewOptions

Properties

addBackgroundDatasource?: boolean

If trueadds a Background Mesh for each tile

Default

true

alpha?: boolean

true if the canvas contains an alpha (transparency) buffer or not. Default is false.

backgroundTilingScheme?: TilingScheme

Set tiling scheme for [[BackgroundDataSource]]

bounds?: GeoBoxExtentLike | GeoBox | GeoCoordLike[] | GeoPolygon

Fit MapView to these boundaries.

If specified, zoomLevel and distance parameters are ignored and lookAt calculates best zoomLevel to fit given bounds.

Note in sphere projection some points are not visible if you specify bounds that span more than 180 degrees in any direction.

See

(MapView.lookAt:WITH_PARAMS) for details on how bounds interact with target parameter

canvas: HTMLCanvasElement

The canvas element used to render the scene.

clipPlanesEvaluator?: ClipPlanesEvaluator

User-defined camera clipping planes distance evaluator. If not defined, TiltViewClipPlanesEvaluator will be used by MapView.

Default

{@link TiltViewClipPlanesEvaluator}
collisionDebugCanvas?: HTMLCanvasElement

An optional canvas element that renders 2D collision debug information.

context?: WebGLRenderingContext
customAntialiasSettings?: IMapAntialiasSettings

Antialias settings for the map rendering. It is better to disable the native antialiasing if the custom antialiasing is enabled.

decoderCount?: number

The number of Web Workers used to decode data. The default is CLAMP(navigator.hardwareConcurrency - 1, 1, 2).

decoderUrl?: string

The URL of the script that the decoder worker runs. The default URL is ./decoder.bundle.js.

Relative URIs are resolved to full URL using the document's base URL (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2).

delayLabelsUntilMovementFinished?: boolean

Enable that new labels are delayed until movement is finished

Default

true

disableFading?: boolean

Disable all fading animations for debugging and performance measurement.

Default

false

distance?: number

Camera distance to the target point in world units.

Default

zoomLevel defaults will be used if not set.
dynamicPixelRatio?: number

Set fixed pixel ratio for rendering when the camera is moving or an animation is running. Useful when rendering on high resolution displays with low performance GPUs that may be fill-rate limited.

If a value is specified, a low resolution render pass is used to render the scene into a low resolution render target, before it is copied to the screen.

A value of undefined disables the low res render pass. Values between 0.5 and window.devicePixelRatio can be tried to give good results. The value should not be larger than window.devicePixelRatio.

Note

Since no anti-aliasing is applied during dynamic rendering with dynamicPixelRatio defined, visual artifacts may occur, especially with thin lines..

Note

The resolution of icons and text labels is not affected.

Default

undefined

enableMixedLod?: boolean

Set true to enable rendering mixed levels of detail (increases rendering performance). If not set will enable mixed levels of detail for spherical projection and disable for other projections.

Default

undefined
enableNativeWebglAntialias?: boolean

Whether the native WebGL antialiasing should be enabled. It is better to disable it if the MapView's MSAA is enabled.

Default

true for pixelRatio < 2.0, false otherwise.

enablePickTechnique?: boolean

Set to true to allow picking of technique information associated with objects.

enablePolarDataSource?: boolean

Should be the PolarTileDataSource used on spherical projection. Default is true.

enableRoadPicking?: boolean

Deprecated

Not needed anymore, roads can be picked by default.

enableShadows?: boolean

Enable shadows in the map. Shadows will only be casted on features that use the "standard" or "extruded-polygon" technique in the map theme.

Default

false
enableStatistics?: boolean

Set to true to measure performance statistics.

extendedFrustumCulling?: boolean

Set to true to extend the frustum culling. This improves the rejection of some tiles, which normal frustum culling cannot detect. You can disable this property to measure performance.

Default

true
fontCatalog?: string

The path to the font catalog file.

fovCalculation?: FovCalculation

How to calculate the Field of View, if not specified, then [[DEFAULT_FOV_CALCULATION]] is used.

heading?: number

Heading angle in degrees and clockwise. 0 is north-up.

Default

0 in {@link MapView.constructor} context.

Default

{@link MapView.heading} in {@link (MapView.lookAt:WITH_PARAMS)} context.
labelDistanceScaleMax?: number

The maximum scaling factor that may be applied to TextElements due to their distance. If not defined the default value specified in TextElementsRenderer will be used.

Default

[[DEFAULT_LABEL_DISTANCE_SCALE_MAX]].
labelDistanceScaleMin?: number

The minimum scaling factor that may be applied to TextElements due to their distance. If not defined the default value specified in TextElementsRenderer will be used.

Default

[[DEFAULT_LABEL_DISTANCE_SCALE_MIN]].
languages?: string[]
lodMinTilePixelSize?: number

If enableMixedLod is true, this value will be used to calculate the minimum Pixel Size of a tile regarding to the screen size. When the area of a tile is smaller then this calculated area on the screen, the subdivision of tiles is stopped and therefore higher level tiles will be rendered instead.

Default

256
maxBounds?: GeoBox

If set, the view will constrained within the given bounds in geo coordinates.

maxDistanceRatioForPoiLabels?: number

The maximum distance for TextElement with icons to be rendered, expressed as a fraction of the distance between the near and far plane [0, 1.0].

Default

[[DEFAULT_MAX_DISTANCE_RATIO_FOR_LABELS]].
maxDistanceRatioForTextLabels?: number

The maximum distance for TextElement to be rendered, expressed as a fraction of the distance between the near and far plane [0, 1.0].

Default

[[DEFAULT_MAX_DISTANCE_RATIO_FOR_LABELS]].
maxFps?: number

Set maximum FPS (Frames Per Second). If VSync in enabled, the specified number may not be reached, but instead the next smaller number than maxFps that is equal to the refresh rate divided by an integer number.

E.g.: If the monitors refresh rate is set to 60hz, and if maxFps is set to a value of 40 (60hz/1.5), the actual used FPS may be 30 (60hz/2). For displays that have a refresh rate of 60hz, good values for maxFps are 30, 20, 15, 12, 10, 6, 3 and 1. A value of 0 is ignored.

maxNumGlyphs?: number

Optional limit of number of glyphs (characters) for labels. In situations with limited, available memory, decreasing this number may be beneficial.

Default

[[MAX_GLYPH_COUNT]]
maxNumVisibleLabels?: number

Limits the number of DataSource labels visible, such as road names and POIs. On small devices, you can reduce this number to to increase performance.

Default

undefined (no limit).

maxPoiDistanceToBorder?: number

The maximum distance to the screen border as a fraction of screen size [0..1].

Default

[[DEFAULT_MAX_DISTANCE_TO_BORDER]].
maxVisibleDataSourceTiles?: number

The maximum number of tiles rendered from one data source at a time.

Default

See [[MapViewDefaults.maxVisibleDataSourceTiles]].
maxZoomLevel?: number

The maximum zoom level. The default is 14.

minCameraHeight?: number

Determines the minimum camera height, in meters.

minNumGlyphs?: number

Optional initial number of glyphs (characters) for labels. In situations with limited, available memory, decreasing this number may be beneficial.

Default

[[MIN_GLYPH_COUNT]]
minZoomLevel?: number

The minimum zoom level; default is 1.

movementThrottleTimeout?: number

Maximum timeout, in milliseconds, before a [[MOVEMENT_FINISHED_EVENT]] is sent after the latest frame with a camera movement. The default is 300ms.

pixelRatio?: number

Set fixed pixel ratio for rendering. Useful when rendering on high resolution displays with low performance GPUs that may be fill-rate limited.

Default

window.devicePixelRatio

polarGeometryLevelOffset?: number

Storage level offset of regular tiles from reference datasource to align PolarTileDataSource tiles to. Default is -1.

polarStyleSetName?: string

The name of the [[StyleSet]] used by PolarTileDataSource to evaluate for the decoding. Default is "polar".

politicalView?: string

Sets the data sources to use specific country point of view (political view).

This option may result in rendering different country borders then commonly accepted for some regions and it mainly regards to so called disputed borders. Although not all data sources or themes may support it.

Note

Country code should be coded in lower-case ISO 3166-1 alpha-2 standard, if this option is undefined the majority point of view will be used.

powerPreference?: MapViewPowerPreference

Hint for the WebGL implementation on which power mode to prefer.

preserveDrawingBuffer?: boolean

Preserve the buffers until they are cleared manually or overwritten.

Set to true in order to copy MapView canvas contents to an image or another canvas.

projection?: Projection

Projection used by the MapView.

The default value is [[mercatorProjection]].

quadTreeSearchDistanceDown?: number

Limits the number of higher zoom levels (more detailed) to be searched for fallback tiles.

When zooming out, newly elected tiles may have not yet loaded. MapView searches through the tile cache for tiles ready to be displayed in higher zoom levels. These tiles may be located deeper in the quadtree.

To disable a cache search, set the value to 0.

Default

[[MapViewDefaults.quadTreeSearchDistanceDown]]
quadTreeSearchDistanceUp?: number

Limits the number of reduced zoom levels (lower detail) to be searched for fallback tiles.

When zooming in, newly elected tiles may have not yet loaded. MapView searches through the tile cache for tiles ready to be displayed in lower zoom levels. The tiles may be located shallower in the quadtree.

To disable a cache search, set the value to 0.

Default

[[MapViewDefaults.quadTreeSearchDistanceUp]]
resourceComputationType?: ResourceComputationType

Specify if the cache should be counted in tiles or in megabytes.

See

[[MapViewDefaults.resourceComputationType]].

showReplacementGlyphs?: boolean

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

Default

false

synchronousRendering?: boolean

Set to true to allow rendering scene synchronously.

By calling renderSync() scene draws immediately, opposite to default case when update method requests redraw and waits for the next animation frame.

You need to set up your own render loop controller. Event MapViewEventNames.Update fired when MapView requests for an redraw. E.g.: When tiles loaded asynchronously and ready for rendering.

Note

Internal maxFps will be overridden and may not work properly as renderSync intended to be called from external render loop.

Default

false.
target?: GeoCoordLike

Target/look at point of the MapView.

Note

If the given point is not on the ground (altitude != 0) MapView will do a raycasting internally to find a target on the ground.

As a consequence target and zoomLevel will not match the values that were passed into the (MapView.lookAt:WITH_PARAMS) method.

Default

new GeoCoordinates(25, 0) in constructor context.

Default

{@link MapView.target} in {@link (MapView.lookAt:WITH_PARAMS)} context.
theme?: string | Theme | Promise<Theme>

The @xyzmaps/harp-datasource-protocol#Theme used by Mapview.

This Theme can be one of the following:

  • string : the URI of the theme file used to style this map
  • Theme : the Theme object already loaded
  • Promise<Theme> : the future Theme object
  • undefined : the theme is not yet set up, but can be set later. Rendering waits until the theme is set.

Note: Layers that use a theme do not render any content until that theme is available.

Relative URIs are resolved to full URL using the document's base URL (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2).

Custom URIs (of theme itself and of resources referenced by theme) may be resolved with help of [[uriResolver]].

See

load for details how theme is loaded

throttlingEnabled?: boolean

Enable throttling for the TaskScheduler

Default

false
@beta
tileCacheSize?: number

Size of a tile cache for one data source.

Default

See [[MapViewDefaults.tileCacheSize]].
tileWrappingEnabled?: boolean

Enable map repeat for planar projections. If true, map will be repeated in longitudinal direction continuously. If false, map will end on lon -180 & 180 deg.

Default

true

tilt?: number

Tilt angle in degrees. 0 is top down view.

Default

0 in {@link MapView.constructor} context.

Default

{@link MapView.tilt} in {@link (MapView.lookAt:WITH_PARAMS)} context.

Note

Maximum supported tilt is 89°

uriResolver?: UriResolver

Resolve URI referenced in MapView assets using this resolver.

Use, to support application/deployment specific URIs into actual URLs that can be loaded with fetch.

Example:

uriResolver: new PrefixMapUriResolver({
"local://poiMasterList": "/assets/poiMasterList.json",
// will match only 'local//:poiMasterList' and
// resolve to `/assets/poiMasterList.json`
"local://icons/": "/assets/icons/"
// will match only 'local//:icons/ANYPATH' (and similar) and
// resolve to `/assets/icons/ANYPATH`
})
zoomLevel?: number

Zoomlevel of the MapView.

Note

Takes precedence over distance.

Default

5 in {@link MapView.constructor} context.

Default

{@link MapView.zoomLevel} in {@link (MapView.lookAt:WITH_PARAMS)} context.

Generated using TypeDoc