new ol.source.Graph(chartsType, name, opt_options)
Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chartsType |
string |
Type of the charts. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name |
string |
Name of the layer. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opt_options |
Object |
parameters.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opt_option.attributions |
string | Object | 'Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>' |
optional
Copyright information. |
Extends
Methods
-
addFeatures(features)
Graph.js, line 73 -
Add data to the thematic map layer. The supported feature types are: The feature json object returned by the iServer or the L.supermap.themeFeature.
Name Type Description features
SuperMap.ServerFeature | L.supermap.themeFeature features to be added.
-
clear()
Graph.js, line 395 -
The contents of cleanup include data (features), thematic elements, and caching.
-
clearCache()
Graph.js, line 353 -
Clear cache.
-
createThematicFeature(feature)
Graph.js, line 136 -
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.
-
destroy()
Graph.js, line 47 -
Disposes the resource. The property that references resource is set to null.
-
inherited destroyFeatures(features)
Theme.js, line 139 -
Destroy one features.
Name Type Description features
SuperMap.Feature.Vector The feature to be destroy.
-
drawCharts()
Graph.js, line 157 -
Draw a chart. Contains the cover treatment.
-
inherited fire(type, event)
Theme.js, line 337 -
Add thematic element event listener.
Name Type Description type
string Type of the event.
event
string Name of the event.
-
inherited getFeatureBy(property, value){SuperMap.Feature.Vector}
Theme.js, line 259 -
Traversing each feature in the element array features of the thematic graph, When feature[property] === value, return to this feature (and return only to the first one).
Name Type Description property
string The name of an attribute for the feature.
value
string The value corresponding to property.
Returns:
Type Description SuperMap.Feature.Vector The first vector element that matches the attributes and values. -
inherited getFeatureById(featureId){SuperMap.Feature.Vector}
Theme.js, line 279 -
Return to a corresponding vector elements by a specified ID.
Name Type Description featureId
string Property ID of the vector feature.
Returns:
Type Description SuperMap.Feature.Vector The feature corresponding to ID, if it does not exist, return to null. -
inherited getFeatures(){SuperMap.Feature.Vector}
Theme.js, line 244 -
Look at the valid data in the current layer.
Returns:
Type Description SuperMap.Feature.Vector The user joins the valid data of the layer. -
inherited getFeaturesByAttribute(attrName, attrValue){Array.<SuperMap.Feature.Vector>}
Theme.js, line 289 -
By giving the key and value of an attribute, return to all the matched features.
Name Type Description attrName
string Key of the property.
attrValue
string Property ID of the vector features.
Returns:
Type Description Array.<SuperMap.Feature.Vector> A matching feature array. -
inherited getLocalXY(coordinate)
Theme.js, line 442 -
Get the coordinate system.
Name Type Description coordinate
Object Coordinate position.
-
getShapesByFeatureID(featureID)
Graph.js, line 255 -
Get all the shapes associated with feature by FeatureID. If this parameter is not passed in, the function returns all the graphs.
Name Type Description featureID
number Feature ID.
-
isChartInMap(mapPxBounds, chartPxBounds)
Graph.js, line 333 -
Determine whether the chart is on the map.
Name Type Description mapPxBounds
SuperMap.Bounds Map pixel range.
chartPxBounds
Array.<Object> An array of quadrilateral nodes in a chart range.
-
isPointInPoly(pt, poly)
Graph.js, line 318 -
Determine whether a point is in a polygon. (ray method)
Name Type Description pt
Object A point object that needs to be determined, which contains the attribute x (abscissa), and the attribute y (ordinate).
poly
Array.<Object> An array of polygonal nodes.
-
isQuadrilateralOverLap(quadrilateral, quadrilateral2)
Graph.js, line 275 -
Determine whether the two quadrilateral has overlay.
Name Type Description quadrilateral
Array.<Object> An array of quadrilateral nodes.
quadrilateral2
Array.<Object> Second quadrilateral nodes array.
-
inherited on(event, callback)
Theme.js, line 319 -
Add thematic element event listener. The events supported include: click, mousedown, mousemove, mouseout, mouseover, mouseup.
Name Type Description event
string Name of the event.
callback
RequestCallback event callbacks.
-
redraw()
Graph.js, line 382 -
Redraw this layer.
-
redrawThematicFeatures(extent)
Graph.js, line 91 -
Redraw all the thematic elements. This method contains all the steps to draw a thematic element, it includes the conversion of user data to thematic elements, thinning, caching, and other steps. This method is called for layer refresh when map roaming.
Name Type Description extent
Object Redrawn range.
-
removeAllFeatures()
Graph.js, line 373 -
Remove all features.
-
removeFeatures(features)
Graph.js, line 362 -
Delete feature from the thematic diagram. This function removes all the vector elements that are passed in. Each item in the features array in the parameter must be the feature that has been added to the current layer.
Name Type Description features
SuperMap.Feature.Vector Features to be deleted.
-
inherited rotate(pixelP, rotation, center)
Theme.js, line 470 -
Get the pixel coordinates after a pixel coordinate point pixelP revolves the rotation arc in the center of the center counterclockwise.
Name Type Description pixelP
number Pixel coordinates point position.
rotation
number Angle of rotation.
center
number Center position.
-
inherited scale(pixelP, center, scaleRatio){Array.<number>}
Theme.js, line 483 -
Get the pixel coordinates of a pixel coordinate point pixelP is scaleRatio times larger than the center.
Name Type Description pixelP
Object Pixel point.
center
Object Center position.
scaleRatio
number Scaling multiplier.
Returns:
Type Description Array.<number> Return array ratio. -
setChartsType(chartsType)
Graph.js, line 63 -
Set type of the charts. This function can dynamically change the chart type. Before calling this function, please do the related configuration for the new type of chart through chartsSetting.
Name Type Description chartsType
string Type of the charts. Currently available: "Bar", "Bar3D", "Line", "Point", "Pie", "Ring".
-
inherited setOpacity(opacity)
Theme.js, line 157 -
Set the opacity of the layer and take the value between [0-1].
Name Type Description opacity
number opacity.
-
inherited deprecated toFeature(features){SuperMap.Feature.Vector}
Theme.js, line 539 -
Converted to an iClient feature, this method will be deprecated and replaced by ol.source.Theme#toiClientFeature.
Name Type Description features
ol.supermap.ThemeFeature | GeoJSONObject | ol.Feature The pending features include the ol.supermap.ThemeFeature type, the GeoJOSN specification data type, and the ol.feature type.
Returns:
Type Description SuperMap.Feature.Vector IClient feature after conversion. -
inherited toiClientFeature(features){SuperMap.Feature.Vector}
Theme.js, line 497 -
Convert to the iClient features.
Name Type Description features
ol.supermap.ThemeFeature | GeoJSONObject | ol.Feature The pending features include the ol.supermap.ThemeFeature type, the GeoJOSN specification data type, and the ol.feature type.
Returns:
Type Description SuperMap.Feature.Vector The converted iClient features. -
inherited un(event, callback)
Theme.js, line 404 -
Removal of thematic element event listener.
Name Type Description event
string Name of the event.
callback
RequestCallback event callbacks.