跳到主要内容

flywave-mapview.mapviewoptions

Home > @flywave/flywave-mapview > MapViewOptions

MapViewOptions interface

User configuration for the MapView.

Signature:

export interface MapViewOptions extends TextElementsRendererOptions, Partial<LookAtParams> 

Extends: TextElementsRendererOptions, Partial<LookAtParams>

Properties

Property

Modifiers

Type

Description

addBackgroundDatasource?

boolean

(Optional) If trueadds a Background Mesh for each tile

false

alpha?

boolean

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

backgroundTilingScheme?

TilingScheme

(Optional) Set tiling scheme for [[BackgroundDataSource]]

canvas

HTMLCanvasElement

The canvas element used to render the scene.

celestiaOptions?

CelestiaOptions

(Optional) Options for Celestia

clipPlanesEvaluator?

ClipPlanesEvaluator

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

TiltViewClipPlanesEvaluator

context?

WebGLRenderingContext

(Optional) Optional WebGL Rendering Context. (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)

customAntialiasSettings?

IMapAntialiasSettings

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

decoderCount?

number

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

decoderUrl?

string

(Optional) 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).

dynamicPixelRatio?

number

(Optional) 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.

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

The resolution of icons and text labels is not affected.

undefined

enableMixedLod?

boolean

(Optional) 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.

undefined

enableNativeWebglAntialias?

boolean

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

true for pixelRatio < 2.0, false otherwise.

enablePickTechnique?

boolean

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

enablePolarDataSource?

boolean

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

enableRoadPicking?

boolean

(Optional)

enableShadows?

boolean

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

enableStatistics?

boolean

(Optional) Set to true to measure performance statistics.

extendedFrustumCulling?

boolean

(Optional) 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.

true

fovCalculation?

FovCalculation

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

languages?

string[]

(Optional)

lodMinTilePixelSize?

number

(BETA) (Optional) 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.

256

logarithmicDepthBuffer?

boolean

(Optional)

maxBounds?

GeoBox

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

maxFps?

number

(Optional) 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.

maxGeometryHeight?

number

(Optional)

maxVisibleDataSourceTiles?

number

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

See [[MapViewDefaults.maxVisibleDataSourceTiles]].

maxZoomLevel?

number

(Optional) The maximum zoom level. The default is 14.

minCameraHeight?

number

(Optional) Determines the minimum camera height, in meters.

minGeometryHeight?

number

(Optional)

minZoomLevel?

number

(Optional) The minimum zoom level; default is 1.

movementThrottleTimeout?

number

(Optional) 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

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

polarGeometryLevelOffset?

number

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

polarStyleSetName?

string

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

politicalView?

string

(Optional) 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.

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

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

preserveDrawingBuffer?

boolean

(Optional) 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.

false.

projection?

Projection

(Optional) Projection used by the MapView.

The default value is [[mercatorProjection]].

quadTreeSearchDistanceDown?

number

(Optional) 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.

[[MapViewDefaults.quadTreeSearchDistanceDown]]

quadTreeSearchDistanceUp?

number

(Optional) 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.

[[MapViewDefaults.quadTreeSearchDistanceUp]]

resourceComputationType?

ResourceComputationType

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

synchronousRendering?

boolean

(Optional) 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.

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

false.

theme?

string | Theme | FlatTheme | Promise<Theme>

(Optional) The 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]].

throttlingEnabled?

boolean

(BETA) (Optional) Enable throttling for the TaskScheduler false

tileCacheSize?

number

(Optional) Size of a tile cache for one data source.

See [[MapViewDefaults.tileCacheSize]].

tileWrappingEnabled?

boolean

(Optional) 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.

true

uriResolver?

UriResolver

(Optional) 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(&#123;
"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`
&#125;)

useMapRenderingManager?

(width: number, height: number, mapView: MapView) => MapRenderingManager

(Optional)

useMapViewEnvironment?

(mapView: MapView, options: MapViewOptions) => MapViewEnvironment

(Optional)

useThemeManager?

(mapView: MapView, uriResolver: UriResolver | undefined) => MapViewThemeManager

(Optional)