new mapboxgl.supermap.Theme3DLayer(id, layerOptions)
| 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.
|
|||||||||||||||||||||||||||||||||||||
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 mapmapboxgl.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 dataGeoJSONObject Data in geojson format
parseNumberboolean 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 highlightOptionsObject The related parameters of layer highlighting.
Name Type Description colorstring optional The color.
callbackfunction 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 layerOptionsObject The related parameters of the layer.
Name Type Default Description opacitynumber 1 optional The opacity of the layer.
parseNumberboolean false optional Whether preprocess the data to number.
baseHeightFieldstring optional The field to represent the base height in the data.
heightnumber 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.
heightFieldstring optional The field to represent the height in the data.
themeFieldstring optional The theme field.
showLegendboolean true optional Whether to show the legend or not.
legendTitlestring The legend title.
legendThemestring 'light' optional The legend theme. Value: 'light','dark'. Default: 'light'.
legendOrientationstring 'horizontal' optional The legend orientation. Value: 'horizontal','vertical'.
legendPositionstring 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 optionsObject Options of the layer.
Returns:
Type Description this This object.