Class: Theme3DLayer

mapboxgl.supermap.Theme3DLayer

The base 3D thematic map layer class. It can not be directly instantiated.

new mapboxgl.supermap.Theme3DLayer(id, layerOptions)

Theme3DLayer.js, line 4
Name Type Default Description
id string optional

id of the thematic map layer.The theme layer ID is created by default using CommonUtil.createUniqueID("theme3DLayer").

layerOptions Object

Options of the thematic map layer.

Name Type Default Description
opacity number 1 optional

The opacity of the layer.

parseNumber boolean fasle optional

Whether preprocess the data to number.

enableHighlight boolean false optional

Whether enable the highlight.

highlight string "#ADA91E" optional

The highlight color.

baseHeightField string optional

The field to represent the base height in the data.

height number optional

The height. A height can be set for all data if the heightField (default height) specified in the data does not contain a field to represent height.

heightField string optional

The field to represent the base height in the data.

themeField string optional

The theme field.

playerOptions.showLegend boolean true optional

Whether to show the legend or not.

layerOptions.legendTitle string optional

The legend title.

layerOptions.legendTheme string 'light' optional

he legend theme. Value: 'light','dark'. Default: 'light'.

layerOptions.legendOrientation string 'horizontal' optional

The legend orientation. Value: 'horizontal','vertical'.

layerOptions.legendPosition string optional

The legend position. Value: 'top-right'|'top-left'|'bottom-left'|'bottom-right'.

Members

baseHeightFieldstring

The field to represent the base height in the data.

enableHighlightboolean

Whether enable the highlight.

heightnumber

The height. A height can be set for all data if the heightField (default height) specified in the data does not contain a field to represent height

heightFieldstring

The field to represent the height in the data.

highlightObject

Highlight the relevant configuration.

Default Value:
{color: "#ADA91E"}

idstring

The layer id of mapbox GL.

legendOrientationstring

The legend orientation. Value: 'horizontal','vertical'.

Default Value:
'horizontal'

legendPositionstring

The legend position. Value: 'top-right'|'top-left'|'bottom-left'|'bottom-right'.

legendThemestring

The legend theme. Value: 'light','dark'.

Default Value:
'light'

legendTitlestring

The legend title.

mapObject

The map object of mapbox GL.

opacitynumber

The opacity of the layer.

Default Value:
1

parseNumberboolean

Whether preprocess the data or not. Some fields need to convert to String, some need to convert to number.

showLegendboolean

Whether to show the legend or not.

Default Value:
true

themeFieldstring

The theme field.

Methods

addTo(map){this}

Theme3DLayer.js, line 184

Add the layer from the map.

Name Type Description
map mapboxgl.Map

he map object of mapbox GL.

Returns:
Type Description
this This object.

getData(){GeoJSONObject}

Theme3DLayer.js, line 175

Get data. The return format of data is geojson.

Returns:
Type Description
GeoJSONObject The data obtained.

getHighlightStyleOptions(){Object}

Theme3DLayer.js, line 260

Get the highlight style. This function should be implement by subclasses.

Returns:
Type Description
Object The style object of mapbox GL.

getLayerStyleOptions(){Object}

Theme3DLayer.js, line 251

Get the layer style.

Returns:
Type Description
Object The style object of mapbox GL.

remove(){this}

Theme3DLayer.js, line 221

Remove the layer from the map.

Returns:
Type Description
this This object.

setData(data, parseNumber)

Theme3DLayer.js, line 151

Set data. The format of data is geojson.

Name Type Default Description
data GeoJSONObject

Data in geojson format

parseNumber boolean false optional

Whether preprocess the data or not. Some fields need to convert to String, some need to convert to number.

setHighlightStyleOptions(highlightOptions){this}

Theme3DLayer.js, line 138

Set related parameters of layer highlighting.

Name Type Description
highlightOptions Object

The related parameters of layer highlighting.

Name Type Description
color string optional

The color.

callback function

The callback. Return to data parameters(data,event).

Returns:
Type Description
this

setLayerOptions(layerOptions){this}

Theme3DLayer.js, line 116

Set related parameters of the layer.

Name Type Description
layerOptions Object

The related parameters of the layer.

Name Type Default Description
opacity number 1 optional

The opacity of the layer.

parseNumber boolean false optional

Whether preprocess the data to number.

baseHeightField string optional

The field to represent the base height in the data.

height number optional

The height. A height can be set for all data if the heightField (default height) specified in the data does not contain a field to represent height.

heightField string optional

The field to represent the height in the data.

themeField string optional

The theme field.

showLegend boolean true optional

Whether to show the legend or not.

legendTitle string

The legend title.

legendTheme string 'light' optional

The legend theme. Value: 'light','dark'. Default: 'light'.

legendOrientation string 'horizontal' optional

The legend orientation. Value: 'horizontal','vertical'.

legendPosition string optional

The legend position. Value: 'top-right'|'top-left'|'bottom-left'|'bottom-right'.

Returns:
Type Description
this

show(options){this}

Theme3DLayer.js, line 200

Show the layer.

Name Type Description
options Object

Options of the layer.

Returns:
Type Description
this This object.