Class: MapboxRenderer

MapboxRenderer

Renderer implementation for Mapbox GL maps.

new MapboxRenderer(gisMap, viewerConfig)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 20

Creates a Mapbox renderer instance.

Name Type Description
gisMap

The GIS map instance.

viewerConfig

Viewer configuration.

Extends

  • undefined

Members

domElement

Gets the DOM element of the renderer.

mapboxMap

Gets the Mapbox map instance.

type

Gets the renderer type.

Methods

addLayer(layer)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 262

Adds a layer to the map.

Name Type Description
layer

Layer configuration.

addSource(id, source)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 250

Adds a source to the map.

Name Type Description
id

Source ID.

source

Source data.

destroy()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 313

Destroys the renderer and cleans up resources.

fitBoundsWGS84(bounds)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 301

Fits the map to the given bounds in WGS84.

Name Type Description
bounds

Bounds as [[lng, lat], [lng, lat]].

getBoundsWGS84()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 290

Gets the bounds in WGS84.

Returns:
Bounds as [[lng, lat], [lng, lat]].

getViewState()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 92

Gets the current view state of the map.

Returns:
The view state.

hide()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 233

Hides the renderer.

removeLayer(layerId)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 274

Removes a layer from the map.

Name Type Description
layerId

Layer ID.

removeSource(sourceId)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 282

Removes a source from the map.

Name Type Description
sourceId

Source ID.

render()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 134

Renders the Mapbox map.

setViewState(v)

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 110

Sets the view state of the map.

Name Type Description
v

The view state to set.

setupResizeObserver()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 47

Sets up a ResizeObserver to automatically resize the map when the container changes size.

show()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 240

Shows the renderer.

asyncwaitUntilReady()

MapboxViewer/infrastructure/adapters/renderers/MapboxRenderer.ts, line 220

Waits until the renderer is fully ready.