Class: GraphThemeLayer

mapboxgl.supermap.GraphThemeLayer

Statistical thematic layers.

new mapboxgl.supermap.GraphThemeLayer(name, chartsType, opt_options)

GraphThemeLayer.js, line 12
Name Type Description
name string

The name of the layer.

chartsType string

The category of the chart.

opt_options Object

The optional parameters.

Name Type Default Description
id string optional

Thematic layer ID. The theme layer ID is created by default using CommonUtil.createUniqueID("themeLayer_").

loadWhileAnimating boolean true optional

Whether to redraw in real time.

map mapboxgl.Map

The current mapboxgl map object.

opacity number 1 optional

The transparency of the layer.

themeFields string

Specifies the field in which the thematic map is created.

isOverLay boolean true optional

Whether to perform the gland processing, if set to true, the chart that produces the gland on the chart that has been drawn in the layer will be hidden during the chart drawing process.

chartsType string optional

Chart type. Currently available: "Bar", "Line", "Pie".

chartsSetting Object

Symbol Circle configured object.

Name Type Default Description
codomain Array.<number>

The data range that the chart allows to display is a one-dimensional array of length 2. The first element represents the lower bound of the range and the second element represents the upper bound of the range.

maxR number optional

The maximum radius of the circle.

minR number optional

The minimum radius of the circle.

fillColor string

A circular fill color, such as: fillColor: "#FFB980".

circleStyle Object

The base style of the circle, this parameter controls the circular base style, with a lower priority than circleStyleByFields and circleStyleByCodomain.

decimalNumber number

Data value array dataValues The number of decimal places of the element value, the decimal point processing parameters of the data, the value range: [0, 16]. If this parameter is not set, the data is not treated with decimal places when fetching data values.

circleHoverStyle Object

The style in the circular hover state, valid when circleHoverAble is true.

circleHoverAble boolean true optional

Whether to allow the circle to use the hover state. Set both circleHoverAble and circleClickAble to false to directly mask the response of the graphic to the thematic layer event.

circleClickAble boolean true optional

Whether to allow the circle to be clicked. Set both circleHoverAble and circleClickAble to false to directly mask the response of the graphic to the thematic layer event.

Fires

Extends

Members

idstring

Thematic layer ID.

loadWhileAnimatingboolean

Whether to redraw in real time.(It is recommended to draw a large amount of data elements, it is recommended to set this parameter to false).

Default Value:
true

Map object.

namestring

The name of the thematic layer.

opacityfloat

The opacity of the layer.

Default Value:
1

visibilityboolean

Whether the layer is visible.

Default Value:
true

Events

beforefeaturesadded

GraphThemeLayer.js, line 68

Triggered before the feature is added.

Properties:
Name Type Description
features SuperMap.ServerFeature

The feature to be added.

inherited changelayer

ThemeLayer.js, line 191

Fires after the layer property changes.

Properties:
Name Type Description
layer Object

Layer.

property string

The changed attribute.

inherited featuresremoved

ThemeLayer.js, line 256

Triggered after the feature is deleted.

Properties:
Name Type Description
features Array.<SuperMap.Feature.Vector>

Features that have not been successfully deleted.

succeed boolean

The deletion is successful or not.

Methods

addFeatures(features)

GraphThemeLayer.js, line 62

Add data to the thematic map layer. The supported feature types are: the feature json object returned by iServer.

Name Type Description
features SuperMap.ServerFeature

The feature to be added.

clear()

GraphThemeLayer.js, line 385

The cleared content includes features, thematic elements, and the cache.

clearCache()

GraphThemeLayer.js, line 344

clear cache.

createThematicFeature(feature)

GraphThemeLayer.js, line 128

Add data to the thematic map layer. The supported feature types are: the feature json object returned by iServer.

Name Type Description
feature Object

The feature to be added.

inherited destroyFeatures(features)

ThemeLayer.js, line 138

Destroy an element.

Name Type Description
features SuperMap.Feature.Vector

The elements that will be destroyed.

inherited display(display)

ThemeLayer.js, line 169

Temporarily hide or show layers. Re-rendering fails by producing immediate effects on CSS controls. The setVisibility method is generally used to dynamically control the display and hiding of layers.

Name Type Description
display boolean optional

Whether to display the layer.

drawCharts()

GraphThemeLayer.js, line 149

Draw a chart. Includes gland handling.

inherited getFeatureBy(property, value){SuperMap.Feature.Vector}

ThemeLayer.js, line 291

Traverses each feature in the feature array features of the thematic map, and returns this feature when feature[property] === value (and returns only the first one).

Name Type Description
property string

The property name of the feature

value string

The value corresponding to property.

Returns:
Type Description
SuperMap.Feature.Vector The first vector feature that matches the attribute and the value.

inherited getFeatureById(featureId){SuperMap.Feature.Vector}

ThemeLayer.js, line 310

Returns the corresponding vector element by giving an id.

Name Type Description
featureId string

The id property of the vector feature

Returns:
Type Description
SuperMap.Feature.Vector The feature corresponding to the id. If it does not exist, return to null.

inherited getFeatures(){SuperMap.Feature.Vector}

ThemeLayer.js, line 277

Get the valid features in the current layer.

Returns:
Type Description
SuperMap.Feature.Vector Return the valid features in the layer.

inherited getFeaturesByAttribute(attrName, attrValue){Array.<SuperMap.Feature.Vector>}

ThemeLayer.js, line 320

Return an array contains all the matched features by giving a key and a value of a an attribute.

Name Type Description
attrName string

The key of the attribute.

attrValue string

The value of the attribute.

Returns:
Type Description
Array.<SuperMap.Feature.Vector> An array contains all the matched features.

inherited getLocalXY(coordinate)

ThemeLayer.js, line 396

Convert the Geographic coordinates to Pixel coordinates.

Name Type Description
coordinate Object optional

The coordinate position.

getShapesByFeatureID(featureID)

GraphThemeLayer.js, line 246

Get all the graphics associated with the feature through the FeatureID. If you do not pass in this parameter, the function will return all graphics.

Name Type Description
featureID number

The ID of the feature.

isChartInMap(mapPxBounds, chartPxBounds)

GraphThemeLayer.js, line 324

Determine if the chart is in the map.

Name Type Description
mapPxBounds SuperMap.Bounds

The range of map pixels.

chartPxBounds Array.<Object>

An array of quadrilateral nodes in the range of the chart.

isPointInPoly(pt, poly)

GraphThemeLayer.js, line 309

Determine if a point is inside a polygon. (ray method)

Name Type Description
pt Object

The point object to be determined, which contains the attribute x (abscissa) and the attribute y (ordinate).

poly Array.<Object>

An array of polygon nodes.

isQuadrilateralOverLap(quadrilateral, quadrilateral2)

GraphThemeLayer.js, line 266

Determine if the two quads have a gland.

Name Type Description
quadrilateral Array.<Object>

An array of quadrilateral nodes.

quadrilateral2 Array.<Object>

An array of the second quadrilateral node.

inherited moveTo(layerID, before)

ThemeLayer.js, line 569

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).

inherited off(event, callback, context)

ThemeLayer.js, line 365

Remove event listeners of the thematic elements.

Name Type Description
event Event

The event listener.

callback function

The callback.

context string

The context.

inherited on(event, callback, context)

ThemeLayer.js, line 349

Add event listeners of the thematic features.

Name Type Description
event Event

The event listener.

callback function

The callback.

context string

The context.

inherited onAdd()

ThemeLayer.js, line 79

Add the layer to the basemap.

redraw()

GraphThemeLayer.js, line 372

Redraw the layer.

redrawThematicFeatures(extent)

GraphThemeLayer.js, line 85

Redraw all thematic elements. This method includes all the steps of drawing the thematic features, including the conversion of user data to thematic features, thinning, caching, and so on. This method is called for layer refresh when the map is roaming.

Name Type Description
extent mapboxgl.LngLatBounds

The scope of redrawing.

removeAllFeatures()

GraphThemeLayer.js, line 363

Remove all features.

removeFeatures(features)

GraphThemeLayer.js, line 353

Remove feature from the thematic map. This function removes all vector features passed in. Each item in the features array in the argument must be a feature that has been added to the current layer.

Name Type Description
features SuperMap.Feature.Vector

The feature to delete.

inherited removeFromMap()

ThemeLayer.js, line 560

Remove the layer.

setChartsType(chartsType)

GraphThemeLayer.js, line 52

Set the type of chart that dynamically changes the chart type. Before calling this function, please use chartsSetting to configure the new type of chart.

Name Type Description
chartsType string optional

Chart type. Currently available: "Bar", "Line", "Pie".

inherited setOpacity(opacity)

ThemeLayer.js, line 178

Set the opacity of the layer, between values [0-1].

Name Type Description
opacity number optional

Opacity.

inherited setVisibility(visibility)

ThemeLayer.js, line 156

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 current map's resolution is between the maximum and minimum resolutions).

inherited toFeature(features){SuperMap.Feature.Vector}

ThemeLayer.js, line 414

Convert to the feature in iClient.

Name Type Description
features mapboxgl.supermap.ThemeFeature | GeoJSONObject

The elements to be converted include the mapboxgl.supermap.ThemeFeature type and the GeoJOSN specification data type.

Returns:
Type Description
SuperMap.Feature.Vector The converted iClient element.