Class: DeckglLayer

mapboxgl.supermap.DeckglLayer

Deckgl High efficiency layer,The layer is a comprehensive layer through which high-efficiency point layers, path layers (line layers), high-efficiency surface layers, curve layers, and regular hexagon layers (honeycomb layers) can be created. , grid layer, only given dependent configuration, so please read the parameter configuration carefully before creating the layer.

new mapboxgl.supermap.DeckglLayer(layerTypeID, options)

DeckglLayer.js, line 14
Name Type Description
layerTypeID string

High efficiency layer type ID,Includes "scatter-plot" high-efficiency point layer, "path-layer" path layer (line layer), "polygon-layer" high-efficiency surface layer, "arc-layer" curve layer, "hexagon-layer" "Positive hexagonal layer (honeycomb layer), "screen-grid-layer" grid layer.

options Object

Layer configuration item, including the following parameters:

Name Type Description
data Array.<GeoJSONObject>

Layer data that supports the GeoJOSN specification data type.

callback Object

The configuration item for the deckgl layer callback function.

layerId Object optional

DeckglLayer the ID of the layer Dom element.The thematic layer ID created by default using CommonUtil.createUniqueID("graphicLayer_" + this.layerTypeID + "_").

props Object

The configuration item of the deckgl layer, under which the configuration items of the layer are configured:

Name Type Default Description
opacity number 1 optional

Public configuration item: Layer transparency.

pickable boolean false optional

Public configuration item:Whether to respond to mouse events (mouse click, mouse swipe).

autoHighlight function false optional

Public configuration item:The mouse slides the highlighted feature.

highlightColor function [0, 0, 128, 128] optional

Public configuration item:The mouse slides to highlight the color.

onClick function optional

Public configuration item:The click event of the mouse.

onHover function optional

Public configuration item:The sliding event of the mouse.

radiusScale number 1 optional

"scatter-plot" configuration item:the ratio of the scatter radius.

outline boolean false optional

"scatter-plot" configuration item:Whether the display of the edge.

strokeWidth number 1 optional

"scatter-plot" configuration item:The width of the edge.

radiusMinPixels number 0 optional

"scatter-plot" configuration item:the value of the smallest pixel of the radius.

radiusMaxPixels number Number.MAX_SAFE_INTEGER optional

"scatter-plot" configuration item:The value of the largest pixel of the radius.

fp64 boolean false optional

"scatter-plot" configuration item:hether the layer should be rendered in a high-precision 64-bit mode.

lightSettings boolean

Public configuration item:Lighting, including the following configurations.

Name Type Default Description
numberOfLights number 1 optional

Lighting configuration item:The maximum value of the illumination value is 5.

lightsPosition Array

Lighting configuration item:The position of the light specified as [x,y,z] in the planar array is in a planar array. The length should be 3 x numberOfLights.

lightsStrength Array

Lighting configuration item:The intensity of the lamp specified as "[x,y]in the planar array. The length should be2 x numberOfLights`.

coordinateSystem number COORDINATE_SYSTEM.LNGLAT optional

Lighting configuration item:Specifies the coordinate system of the lamp position.

coordinateOrigin number [0, 0, 0] optional

Lighting configuration item:Specifies the coordinate origin of the lamp position.

modelMatrix number null optional

Lighting configuration item:The transformation matrix of the light position.

ambientRatio number 0.4 optional

Lighting configuration item:The proportion of the environment in which the light is illuminated.

diffuseRatio number 0.6 optional

Lighting configuration item:The diffuse reflectance of light.

specularRatio number 0.8 optional

Lighting configuration item:Specular reflectance of light.

widthScale number 1 optional

"path-layer" configuration item:The ratio of the line width.

widthMinPixels number 0 optional

"path-layer" configuration item:The ratio of the line width.

widthMaxPixels number Number.MAX_SAFE_INTEGER optional

"path-layer" configuration item:The maximum pixel value of the line width.

rounded boolean false optional

"path-layer" configuration item:Whether the node is drawn as an arc.

miterLimit number 4 optional

"path-layer" configuration item:The maximum range of nodes relative to the line width, valid only when rounded is false.

fp64 boolean false optional

"path-layer" configuration item:Whether the layer should be rendered in a high-precision 64-bit mode.

dashJustified boolean false optional

"path-layer" configuration item:Whether it is displayed as a dotted line, valid only when the getDashArray() callback function is specified.

filled boolean true optional

"polygon-layer" configuration item:Whether to fill the surface.

stroked boolean true optional

"polygon-layer" configuration item:Whether to draw an edge.

extruded boolean false optional

"polygon-layer" configuration item:Whether to stretch the building.

wireframe boolean false optional

"polygon-layer" configuration item:Whether to depict the edges of a building when it is stretched into a building.

elevationScale boolean 1 optional

"polygon-layer" configuration item:Altitude ratio.

lineWidthScale boolean 1 optional

"polygon-layer" configuration item:Line width ratio.

lineWidthMinPixels boolean 0 optional

"polygon-layer" configuration item:The minimum pixel value of the line width.

lineWidthMaxPixels boolean Number.MAX_SAFE_INTEGER optional

"polygon-layer" configuration item:The maximum pixel value of the line width.

lineJointRounded boolean false optional

"polygon-layer" configuration item:Whether the node is drawn as an arc.

lineMiterLimit boolean 4 optional

"polygon-layer" configuration item:The maximum range of nodes relative to line width, valid only when lineJointRounded is false.

lineDashJustified boolean false optional

"polygon-layer" configuration item:Whether it is displayed as a dotted line, valid only when the getLineDashArray() callback function is specified.

fp64 boolean false optional

"polygon-layer" configuration item:Whether the layer should be rendered in high-precision 64-bit mode.

fp64 boolean false optional

"arc-layer" configuration item:Whether the layer should be rendered in a high-precision 64-bit mode.

strokeWidth boolean 1 optional

"arc-layer" configuration item:Line width.

radius boolean 1000 optional

"hexagon-layer" configuration item:Hexagon radius value.

extruded boolean false optional

"hexagon-layer" configuration item:Whether to stretch the feature.

coverage boolean

"hexagon-layer" configuration item:The hexagonal radius multiplier, between 0 and 1. The final radius of the hexagon is calculated by the radius of coverage. Note: Coverage does not affect how scores are assigned. Note: Coverage does not affect how scores are assigned. The radius of the distribution method is determined only by the radius attribute.

upperPercentile boolean 100 optional

"hexagon-layer" configuration item:Filter the box and recalculate the color with upperPercentile. Hexagons with color values greater than upperPercentile will be hidden.

elevationScale boolean 1 optional

"hexagon-layer" configuration item:The elevation multiplier, the actual altitude is calculated by elevationScale * getElevation(d). elevationScale is a handy property that scales all hexagons without updating the data.

hexagonAggregator boolean

"hexagon-layer" configuration item:

colorDomain boolean false optional

"hexagon-layer" configuration item:Levels.

colorRange boolean [[255,255,178,255],[254,217,118,255],[254,178,76,255],[253,141,60,255],[240,59,32,255],[189,0,38,255]] optional

"hexagon-layer" configuration item:ribbon.

Members

graphicsArray.<mapboxgl.supermap.Graphic>

An array of point feature objects.

idstring

The id of the high efficiency point layer.

visibilityboolean

The layer shows the properties of the state.

Default Value:
true

Methods

addData(data)

DeckglLayer.js, line 239

Add a point feature that will not overwrite the previous feature.

Name Type Description
data Array.<Object>

An array of point feature objects.

clear()

DeckglLayer.js, line 283

Release layer resources.

moveTo(layerID, before)

DeckglLayer.js, line 158

Move the layer before a layer.

Name Type Default Description
layerID string

The layer ID to be inserted.

before boolean true optional

Whether to insert this layer before the layer whose layer id is layerID (if it is false, insert this layer after the layer whose layer id is layerID).

onAdd(map){mapboxgl.supermap.DeckglLayer}

DeckglLayer.js, line 105
Name Type Description
map mapboxgl.Map

The object of the Mapbox GL map.

Returns:
Type Description
mapboxgl.supermap.DeckglLayer

remove()

DeckglLayer.js, line 138

Delete the layer.

removeData()

DeckglLayer.js, line 293

Remove all features.

removeFromMap()

DeckglLayer.js, line 148

Delete the layer.

Deprecated
  • Yes

setData(data)

DeckglLayer.js, line 217

Setting the plotted point feature data will overwrite all previous features.

Name Type Description
data Array.<Object>

An array of point feature objects.

setStyle(styleOptions)

DeckglLayer.js, line 198

Set the overall style of the layer.

Name Type Description
styleOptions Object

The style of the object.

Name Type Default Description
color Array.<number> [0, 0, 0, 255] optional

The color of the point.

radius number 10 optional

The radius of the point.

opacity number 0.8 optional

Opacity.

highlightColor Array optional

Highlight color, currently only supports rgba arrays.

radiusScale number 1 optional

The multiple of the point magnification.

radiusMinPixels number 0 optional

The minimum radius (pixels).

radiusMaxPixels number Number.MAX_SAFE_INTEGER optional

The maximum radius (pixels).。

strokeWidth number 12 optional

The size of the border.

outline boolean false optional

Whether to display the border.

setVisibility(visibility)

DeckglLayer.js, line 184

Set layer visibility, set the layer's hidden, display, and redraw corresponding visible markers.

Name Type Description
visibility boolean optional

Whether to display the layer (the resolution of the current map is between the maximum and minimum resolutions).

update()

DeckglLayer.js, line 257

Update the layer.