L.supermap.GeoFeatureThemeLayer(name, options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
The name of the thematic layer. |
||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
The parameters object need to be set.
|
Fires
- L.supermap.GeoFeatureThemeLayer#event:beforefeaturesadded You can give an independent style to special data (feature) in this way.
Extends
Events
-
beforefeaturesadded
GeoFeatureThemeLayer.js, line 72 -
Fires before adding data to the thematic map layer.
Properties:
Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature | GeoJSONObject Event object.
-
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
-
addFeatures(features)
GeoFeatureThemeLayer.js, line 65 -
Add data to the thematic layer. Supports type of the feature is the feature json object returned by iServer or the L.supermap.themeFeature.
Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature | GeoJSONObject The feature to be added.
-
clear()
GeoFeatureThemeLayer.js, line 236 -
Clear all the content including data(features), the thematic elements, the cache.
-
clearCache()
GeoFeatureThemeLayer.js, line 227 -
Clear data in cache.
-
createThematicFeature(feature)
GeoFeatureThemeLayer.js, line 187 -
Create the thematic feature(chart).
Name Type Description feature
L.feature The thematic feature to be created.
-
inherited destroyFeatures(features)
ThemeLayer.js, line 136 -
Destroy features.
Name Type Description features
Array.<SuperMap.Feature.Vector> Features to be destroy.
-
getCacheCount(){number}
GeoFeatureThemeLayer.js, line 248 -
Get counts of current cache.
Returns:
Type Description number Return the counts of current cache. -
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.
-
getShapesByFeatureID(featureID)
GeoFeatureThemeLayer.js, line 270 -
Get all graphics associated with the feature by FeatureID. The function will return all the graphics if no parameter pass in.
Name Type Description featureID
number ID of the feature.
-
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.
-
redraw()
GeoFeatureThemeLayer.js, line 218 -
Redraw this layer.
-
redrawThematicFeatures(bounds)
GeoFeatureThemeLayer.js, line 116 -
Redraw all the thematic elements. This function contains all the steps to draw a thematic element, including the conversion of user data to thematic elements, thinning, caching and other steps. This function is called for layer refresh when map roaming.
Name Type Description bounds
L.bounds The redrawn region.
-
removeAllFeatures()
GeoFeatureThemeLayer.js, line 107 -
Remove all vector features in the current layer.
-
removeFeatures(features)
GeoFeatureThemeLayer.js, line 97 -
Remove features from the thematic map. This function deletes all passed vector features (data). Each item in the array of features must the feature that has been added to the current layer.
Name Type Description features
SuperMap.Feature.Vector The feature object to be removed。
-
setMaxCacheCount(cacheCount)
GeoFeatureThemeLayer.js, line 257 -
Set the maximum count of cache
Name Type Description cacheCount
number The maximum count of cache.
-
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.