L.supermap.graphThemeLayer(name, chartsType, options)
The graph thematic map draws charts for each element to reflect the corresponding thematic value. It can express multiple field attribute information, and form a horizontal and vertical contrast between the region itself and different regions. Graph thematic maps are usually used to show demographic information, for example, GDP, Crop product, and population of each state. Currently it provides a statistical chart type: bar, line, pie, bar3D, point, and ring.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
The name for the layer. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
chartsType |
string |
Chart type, required, currently supports: "Bar", "Bar3D", "Line", "Point", "Pie", "Ring". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
The graph themeLayer parameters.
|
Extends
Events
-
inherited changelayer
ThemeLayer.js, line 509 -
Fires after the layer property changes.
Properties:
Name Type Description layer
Object Layer.
property
string Layer properties.
-
inherited featuresremoved
ThemeLayer.js, line 204 -
Triggered after the deleted feature succeeds.
Properties:
Name Type Description features
Array.<SuperMap.Feature.Vector> Event object.
succeed
boolean To delete whether the deletion is successful, true is the deletion succeeds, false is the deletion failure.
Methods
-
inherited addFeatures(features)
ThemeLayer.js, line 118 -
Add data to the thematic map. It supports the following type of the feature: the feature object in json format returned from iServer or the L.supermap.themeFeature
Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature | GeoJSONObject The feature to be added.
-
inherited destroyFeatures(features)
ThemeLayer.js, line 136 -
Destroy features.
Name Type Description features
Array.<SuperMap.Feature.Vector> Features to be destroy.
-
inherited getEvents(){Object}
ThemeLayer.js, line 50 -
Get the event of the layer.
Returns:
Type Description Object Return the event supported by the layer. -
inherited getFeatureBy(property, value)
ThemeLayer.js, line 241 -
Ergodic every feature of the features array in the thematic map. If feature[property] === value, return this feature (and only return the first one).
Name Type Description property
string The property name of the feature.
value
string The value corresponding to property.
-
inherited getFeatureById(featureId)
ThemeLayer.js, line 261 -
Return the corresponding vector features by the specified id. If it does not exist, return to null.
Name Type Description featureId
number The id property of the vector feature.
-
inherited getFeatures(){Array}
ThemeLayer.js, line 226 -
Get valid features in the current layer.
Returns:
Type Description Array Return valid features in the layer. -
inherited getFeaturesByAttribute(attrName, attrValue){Array}
ThemeLayer.js, line 270 -
Retucrn 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 name of the attribute.
attrValue
string The value of the attribute.
Returns:
Type Description Array Return all the matched feature arrays. -
inherited getLocalXY(coordinate)
ThemeLayer.js, line 407 -
Convert the Geographic coordinates to Pixel coordinates.
Name Type Description coordinate
Array The coordinate object.
-
inherited off(event, callback, context)
ThemeLayer.js, line 375 -
Remove event listeners from the thematic features
Name Type Description event
Event The event listener.
callback
function The callback.
context
string The context,
-
inherited on(event, callback, context)
ThemeLayer.js, line 359 -
Add event listeners on the thematic features.
Name Type Description event
Event The event listener.
callback
function The callback.
context
string The context.
-
inherited onRemove(map)
ThemeLayer.js, line 68 -
Remove the map.
Name Type Description map
L.Map The map to be removed.
-
inherited redraw(){boolean}
ThemeLayer.js, line 341 -
Redraw this layer
Returns:
Type Description boolean Whether redraw success or not. -
inherited redrawThematicFeatures(bounds)
ThemeLayer.js, line 127 -
Redraw thematic features. It is an abstract function. This method should be implemented by instantiable subclasses
Name Type Description bounds
L.bounds The bounds of redrawing the thematic feature.
-
inherited removeAllFeatures()
ThemeLayer.js, line 213 -
Remove all vector features on the current layer.
-
inherited removeFeatures(features)
ThemeLayer.js, line 154 -
Remove features from the thematic layer. This function removes all vector features (data) passed in.
Name Type Description features
Array.<SuperMap.Feature.Vector> The features array to be removed.
-
inherited setOpacity(opacity)
ThemeLayer.js, line 325 -
Set opacity of the layer. The value is between 0 and 1.
Name Type Description opacity
number The opacity.
-
inherited toFeature(features){SuperMap.Feature.Vector}
ThemeLayer.js, line 467 -
Convert to the iClient features, this method will be deprecated and replaced by
L.supermap.ThemeLayer#toiClientFeature
.Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature | GeoJSONObject The pending features include the
L.supermap.ThemeFeature
type and the GeoJOSN specification data type.- Deprecated
- Yes
Returns:
Type Description SuperMap.Feature.Vector The converted iClient features. -
inherited toiClientFeature(features){Array.<SuperMap.Feature.Vector>}
ThemeLayer.js, line 432 -
Convert to the iClient features.
Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature | GeoJSONObject The pending features include the
L.supermap.ThemeFeature
type and the GeoJOSN specification data type.Returns:
Type Description Array.<SuperMap.Feature.Vector> The converted iClient features. -
inherited update(bounds)
ThemeLayer.js, line 290 -
Update the layer.
Name Type Description bounds
L.bounds Bounds of the layer.