Reference·JavaScript · @bimworks/viewer3dJavaScript

GisLayer

Type alias in @bimworks/viewer3d.

API catalogue · @bimworks/viewer3d · Type alias

TypeScript#
type GisLayer = {
  assetId?: number | string;
  authorization?: string;
  colors?: Record<string, [number, number, number, number]>;
  concurrency?: number;
  contentRevision?: string | number;
  coordinateMode?: "GEOGRAPHIC" | "LOCAL";
  description?: string;
  faceColor?: string | (number)[];
  fetchContent?: (viewRegion: unknown) => Promise<unknown>;
  heightDatum?: "orthometric" | "ellipsoid";
  heightOffsetMeters?: number;
  humanUrl?: string;
  icon?: string;
  id?: string;
  layerJsonUrl?: string;
  lod?: string | number;
  maxTiles?: number;
  maxZoomLevel?: number;
  name: string;
  opacity?: number;
  params?: { format?: string; layers?: string; styles?: string; transparent?: boolean | string; version?: string; [name: string]: unknown };
  regions?: (string)[];
  regionZoom?: number;
  renderTileBorder?: boolean;
  snapToZero?: boolean;
  source?: string;
  terrain?: string;
  tileSizePixels?: number;
  translationMm?: vec3;
  type: "3DTILES" | "WMS" | "TMS" | "TERRAIN" | "WMTS" | "UPLOADED_GIS";
  url?: URL | string;
  urlBuilder?: (settings: unknown, zoom: number, x: number, y: number) => string;
  version?: string;
  visible?: boolean;
  visibleInMenu?: boolean;
  zoomOffset?: number;
};

A GIS layer definition for Viewer3d.addGisLayer

Members#

Member Kind Description
assetId Property 3DTILES from Cesium ion: the asset id, used with authorization
authorization Property 3DTILES from Cesium ion: the ion access token. The viewer exchanges it at api.cesium.com for the asset's token and sends that as a Bearer token with every ti…
colors Property 3DTILES: colour per glTF mesh name, RGBA in 0..1, instead of the material's base colour
concurrency Property TERRAIN: parallel tile requests (default 8)
contentRevision Property UPLOADED_GIS: changes when the content changes, so cached content is refetched
coordinateMode Property UPLOADED_GIS: "GEOGRAPHIC" (WGS84 content placed by the georeference) or "LOCAL" (model coordinates)
description Property
faceColor Property TERRAIN loaded on its own: face colour as "#RRGGBB" or [r, g, b] in 0..1 (default light blue, #ADD8E6)
fetchContent Property UPLOADED_GIS: fetches the content for a view region
heightDatum Property TERRAIN and 3DTILES: what the service's heights are measured from. "ellipsoid" (the Cesium convention, e.g. 3D BAG) makes the viewer subtract the geoid heigh…
heightOffsetMeters Property TERRAIN and 3DTILES: constant added to the service's heights before the placement (e.g. minus the geoid undulation of an ellipsoidal service); a terrain's sn…
humanUrl Property
icon Property
id Property Default the id addGisLayer is given
layerJsonUrl Property TERRAIN: explicit URL of the layer metadata; default url + "layer.json", then url?f=json (OGC API services)
lod Property UPLOADED_GIS (CityJSON): the level of detail to show
maxTiles Property TERRAIN: cap on tiles fetched per load (default 400)
maxZoomLevel Property Imagery: the Web Mercator zoom of the tiles. TERRAIN: the preferred quantized-mesh level (default 17); it is lowered until maxTiles fits
name Property
opacity Property 0..1, default 1 (opaque); applied to every (re)build of the layer, change it with Viewer3d.setGisLayerOpacity
params Property WMS: the GetMap parameters: layers, styles, version ("1.1.1" default, or "1.3.0"), format (default "image/png"), transparent (default true); any other key is…
regions Property Region codes shown as flags in the GIS panel, e.g. "NL", "EE", "WORLD"
regionZoom Property TERRAIN loaded on its own: Web Mercator zoom whose 23x23-tile footprint the mesh covers (default 18, the same area as the national orthophotos)
renderTileBorder Property
snapToZero Property Flat layers: put the plane at the model's lowest point (default true without terrain). With terrain: lift the terrain under the origin to the model's lowest …
source Property
terrain Property Imagery (TMS, WMS, WMTS): id of a TERRAIN layer to drape over. Switching the imagery on switches that terrain on; while the terrain is on the imagery drapes …
tileSizePixels Property
translationMm Property
type Property TERRAIN layers carry no imagery: on their own they are drawn flat-shaded in faceColor; as the terrain companion of a TMS layer they drape that layer's ti…
url Property
urlBuilder Property
version Property
visible Property
visibleInMenu Property false hides the layer from the legacy GIS window
zoomOffset Property

assetId#

TypeScript#
assetId?: number | string

3DTILES from Cesium ion: the asset id, used with authorization

authorization#

TypeScript#
authorization?: string

3DTILES from Cesium ion: the ion access token. The viewer exchanges it at api.cesium.com for the asset's token and sends that as a Bearer token with every tile request

colors#

TypeScript#
colors?: Record<string, [number, number, number, number]>

3DTILES: colour per glTF mesh name, RGBA in 0..1, instead of the material's base colour

concurrency#

TypeScript#
concurrency?: number

TERRAIN: parallel tile requests (default 8)

contentRevision#

TypeScript#
contentRevision?: string | number

UPLOADED_GIS: changes when the content changes, so cached content is refetched

coordinateMode#

TypeScript#
coordinateMode?: "GEOGRAPHIC" | "LOCAL"

UPLOADED_GIS: "GEOGRAPHIC" (WGS84 content placed by the georeference) or "LOCAL" (model coordinates)

description#

TypeScript#
description?: string

faceColor#

TypeScript#
faceColor?: string | (number)[]

TERRAIN loaded on its own: face colour as "#RRGGBB" or [r, g, b] in 0..1 (default light blue, #ADD8E6)

fetchContent#

TypeScript#
fetchContent?: (viewRegion: unknown) => Promise<unknown>

UPLOADED_GIS: fetches the content for a view region

heightDatum#

TypeScript#
heightDatum?: "orthometric" | "ellipsoid"

TERRAIN and 3DTILES: what the service's heights are measured from. "ellipsoid" (the Cesium convention, e.g. 3D BAG) makes the viewer subtract the geoid height of its embedded tables (the Netherlands today) before the placement; outside the tables a terrain snaps to the model instead and a tile set keeps its heights (with a warning), unless heightOffsetMeters is given. Default "orthometric": national-datum heights, no shift (EHR)

heightOffsetMeters#

TypeScript#
heightOffsetMeters?: number

TERRAIN and 3DTILES: constant added to the service's heights before the placement (e.g. minus the geoid undulation of an ellipsoidal service); a terrain's snap placement ignores it, a tile set applies it under both policies

humanUrl#

TypeScript#
humanUrl?: string

icon#

TypeScript#
icon?: string

id#

TypeScript#
id?: string

Default the id addGisLayer is given

layerJsonUrl#

TypeScript#
layerJsonUrl?: string

TERRAIN: explicit URL of the layer metadata; default url + "layer.json", then url?f=json (OGC API services)

lod#

TypeScript#
lod?: string | number

UPLOADED_GIS (CityJSON): the level of detail to show

maxTiles#

TypeScript#
maxTiles?: number

TERRAIN: cap on tiles fetched per load (default 400)

maxZoomLevel#

TypeScript#
maxZoomLevel?: number

Imagery: the Web Mercator zoom of the tiles. TERRAIN: the preferred quantized-mesh level (default 17); it is lowered until maxTiles fits

name#

TypeScript#
name: string

opacity#

TypeScript#
opacity?: number

0..1, default 1 (opaque); applied to every (re)build of the layer, change it with Viewer3d.setGisLayerOpacity

params#

TypeScript#
params?: { format?: string; layers?: string; styles?: string; transparent?: boolean | string; version?: string; [name: string]: unknown }

WMS: the GetMap parameters: layers, styles, version ("1.1.1" default, or "1.3.0"), format (default "image/png"), transparent (default true); any other key is passed on as a query parameter. The loader sets service, request, the CRS, bbox, width and height itself

regions#

TypeScript#
regions?: (string)[]

Region codes shown as flags in the GIS panel, e.g. "NL", "EE", "WORLD"

regionZoom#

TypeScript#
regionZoom?: number

TERRAIN loaded on its own: Web Mercator zoom whose 23x23-tile footprint the mesh covers (default 18, the same area as the national orthophotos)

renderTileBorder#

TypeScript#
renderTileBorder?: boolean

snapToZero#

TypeScript#
snapToZero?: boolean

Flat layers: put the plane at the model's lowest point (default true without terrain). With terrain: lift the terrain under the origin to the model's lowest point instead of using the georeference elevation. 3DTILES: put the set's height 0 at the model's lowest point (default true) instead of placing the tiles by the georeference elevation

source#

TypeScript#
source?: string

terrain#

TypeScript#
terrain?: string

Imagery (TMS, WMS, WMTS): id of a TERRAIN layer to drape over. Switching the imagery on switches that terrain on; while the terrain is on the imagery drapes over it, switching the terrain off flattens the imagery. Without a reference the layer drapes over whichever TERRAIN layer is visible. A terrain that imagery drapes over is not drawn on its own (terrain fusion)

tileSizePixels#

TypeScript#
tileSizePixels?: number

translationMm#

TypeScript#
translationMm?: vec3

type#

TypeScript#
type: "3DTILES" | "WMS" | "TMS" | "TERRAIN" | "WMTS" | "UPLOADED_GIS"

TERRAIN layers carry no imagery: on their own they are drawn flat-shaded in faceColor; as the terrain companion of a TMS layer they drape that layer's tiles. UPLOADED_GIS: vector content the server prepared (GeoJSON, CityJSON, KLIC files, OGC API features), fetched with fetchContent

url#

TypeScript#
url?: URL | string

urlBuilder#

TypeScript#
urlBuilder?: (settings: unknown, zoom: number, x: number, y: number) => string

version#

TypeScript#
version?: string

visible#

TypeScript#
visible?: boolean

visibleInMenu#

TypeScript#
visibleInMenu?: boolean

false hides the layer from the legacy GIS window

zoomOffset#

TypeScript#
zoomOffset?: number