Class: rangeThemeLayer

L.supermap.rangeThemeLayer

The RangeThemeLayer class.

L.supermap.rangeThemeLayer(name, options)

RangeThemeLayer.js, line 6

Range thematic maps segment the values of attribute fields(attributes) in the data (SuperMap.Feature.Vector). These ranges are shaded with different colors, patterns, line styles, or symbols. In a range map, the thematic values are divided into several ranges according to a certain ranging method. A range is assigned to each feature based on the corresponding thematic value. The same styles, such as color, fill, and symbol, are applied to features of the same range. Range maps are usually used to represent volume or degree characteristics of continuously distributed phenomena, such as distribution of precipitation and distribution of soil erosion rate.

Name Type Description
name string

The name of the layer.

options Object

The optional parameters of the layer.

Name Type Default Description
id string optional

Theme layer ID。The theme layer ID is created by default using CommonUtil.createUniqueID("ThemeLayer_").

opacity number 1 optional

Layer opacity.

alwaysMapCRS boolean false optional

Whether the feature coordinates are consistent with the map coordinate system, and the feature defaults to the latitude and longitude coordinates.

TFEvents Array optional

Thematic feature events are temporarily stored.

nodesClipPixel number 2 optional

Pixel distance of vacuation node.

isHoverAble boolean false optional

Whether the graphics are bright in hover.

isMultiHover boolean false optional

Whether multiple graphics are bright at the same time. It is used to highlight all the features that correspond to the same data (such as multi region).

isClickAble boolean true optional

Whether the graphics can be clicked.

isAllowFeatureStyle boolean false optional

Whether the valid attributes in the feature style are allowed to be applied to the thematic layer.

attribution string 'Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>' optional

Copyright description information. It prohibits from using style of data (feature) for thematic features. This property can compulsively apply the valid attributes in the feature style to the thematic features. And it has a higher priority than the layer style and styleGroups, making the style of the thematic features out of the control of the thematic layer. You can give an independent style to special data (feature) in this way.

Extends

Members

highlightStyleObject

The style style that is triggered when the hover event is turned on.

styleObject

Thematic map style.

styleGroupsObject

Each theme type style group.

Events

inherited 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

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

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 data in cache.

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

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

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

getStyleByData(feat){Array.<SuperMap.ThemeStyle>}

RangeThemeLayer.js, line 65

Get style according to user data (feature).

Name Type Description
feat SuperMap.Feature.Vector

The vector feature object.

Returns:
Type Description
Array.<SuperMap.ThemeStyle> An style array of thematic elements.

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

GeoFeatureThemeLayer.js, line 218

Redraw this layer.

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

inherited removeAllFeatures()

GeoFeatureThemeLayer.js, line 107

Remove all vector features in the current layer.

inherited 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。

inherited 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 deprecated 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.

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.