new mapboxgl.supermap.UniqueThemeLayer(name, opt_options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
The name of the layer. |
||||||||||||||||||||||||||||||||||||
opt_options |
Object |
The optional parameters of the layer.
|
Extends
Members
-
highlightStyleSuperMap.ThemeStyle
-
The highlight style of the thematic map layer.
-
idstring
-
Thematic layer ID.
-
isAllowFeatureStyleboolean
-
Whether to allow valid attributes in the feature style to be applied to the thematic layer. It is forbidden to use the style of the feature for the thematic feature. This property enforces the application of valid attributes in the style of the data feature to the thematic feature and has a higher priority than the layer style and styleGroups. Make the style of the thematic feature out of the control of the thematic layer. In this way, you can assign a unique style to the feature elements of the special data.
-
isClickAbleboolean
-
Whether the graphics can be clicked.
- Default Value: true
isHoverAbleboolean
Whether the graphics are bright in hover.
isMultiHoverboolean
Whether multiple graphics are highlighted at the same time, used to highlight all graphics corresponding to the same data (such as: multi-faceted).
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
mapmapboxgl.Map
Map object.
namestring
The name of the thematic layer.
nodesClipPixelnumber
Pixel distance of nodes vacuation.
- Default Value: 2
opacityfloat
The opacity of the layer.
- Default Value: 1
styleSuperMap.ThemeStyle
The global style of thematic map layer.
visibilityboolean
Whether the layer is visible.
- Default Value: true
Events
-
inherited beforefeaturesadded
GeoFeatureThemeLayer.js, line 92 -
Triggered before the feature is added.
Properties:
Name Type Description features
mapboxgl.supermap.ThemeFeature | SuperMap.ServerFeature The added elements.
-
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
-
inherited addFeatures(features)
GeoFeatureThemeLayer.js, line 86 -
Adding features.
Name Type Description features
mapboxgl.supermap.ThemeFeature | SuperMap.ServerFeature Feature object.
-
inherited clear()
GeoFeatureThemeLayer.js, line 236 -
Clear all the content including data(features), the thematic elements, the cache.
-
inherited clearCache()
GeoFeatureThemeLayer.js, line 227 -
Clear cache.
-
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.
-
inherited getCacheCount(){number}
GeoFeatureThemeLayer.js, line 247 -
Get counts of current cache.
Returns:
Type Description number Return the counts of current cache. -
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.
-
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.
-
inherited redrawThematicFeatures(extent)
GeoFeatureThemeLayer.js, line 129 -
Redraw all the thematic elements.
Name Type Description extent
mapboxgl.LngLatBounds The redrawn region.
-
inherited removeAllFeatures()
GeoFeatureThemeLayer.js, line 120 -
Clear all vector features of the current layer.
-
inherited removeFeatures(features)
GeoFeatureThemeLayer.js, line 110 -
Remove features from the thematic map. This function deletes all passed vector features (data).
Name Type Description features
SuperMap.Feature.Vector The feature object to be removed.
-
inherited removeFromMap()
ThemeLayer.js, line 560 -
Remove the layer.
-
inherited setMaxCacheCount(cacheCount)
GeoFeatureThemeLayer.js, line 256 -
The maximum count of caches.
Name Type Description cacheCount
number optional count of caches.
-
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.