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 featuresol.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 featureObject 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 featuresol.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 typestring Type of the event.
eventstring Name of the event.
-
inherited getFeatureBy(property, value){ol.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 propertystring The name of an attribute for the feature.
valuestring The value corresponding to property.
Returns:
Type Description ol.supermap.Feature.Vector The first vector element that matches the attributes and values. -
inherited getFeatureById(featureId){ol.supermap.Feature.Vector}
Theme.js, line 279 -
Return to a corresponding vector elements by a specified ID.
Name Type Description featureIdstring Property ID of the vector feature.
Returns:
Type Description ol.supermap.Feature.Vector The feature corresponding to ID, if it does not exist, return to null. -
inherited getFeatures(){ol.supermap.Feature.Vector}
Theme.js, line 244 -
Look at the valid data in the current layer.
Returns:
Type Description ol.supermap.Feature.Vector The user joins the valid data of the layer. -
inherited getFeaturesByAttribute(attrName, attrValue){Array.<ol.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 attrNamestring Key of the property.
attrValuestring Property ID of the vector features.
Returns:
Type Description Array.<ol.supermap.Feature.Vector> A matching feature array. -
inherited getLocalXY(coordinate)
Theme.js, line 442 -
Get the coordinate system.
Name Type Description coordinateObject 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 featureIDnumber Feature ID.
-
isChartInMap(mapPxBounds, chartPxBounds)
Graph.js, line 333 -
Determine whether the chart is on the map.
Name Type Description mapPxBoundsol.supermap.Bounds Map pixel range.
chartPxBoundsArray.<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 ptObject A point object that needs to be determined, which contains the attribute x (abscissa), and the attribute y (ordinate).
polyArray.<Object> An array of polygonal nodes.
-
isQuadrilateralOverLap(quadrilateral, quadrilateral2)
Graph.js, line 275 -
Determine whether the two quadrilateral has overlay.
Name Type Description quadrilateralArray.<Object> An array of quadrilateral nodes.
quadrilateral2Array.<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 eventstring Name of the event.
callbackRequestCallback 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 extentObject 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 featuresol.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 pixelPnumber Pixel coordinates point position.
rotationnumber Angle of rotation.
centernumber 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 pixelPObject Pixel point.
centerObject Center position.
scaleRationumber 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 chartsTypestring 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 opacitynumber opacity.
-
inherited deprecated toFeature(features){ol.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 featuresol.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 ol.supermap.Feature.Vector IClient feature after conversion. -
inherited toiClientFeature(features){ol.supermap.Feature.Vector}
Theme.js, line 497 -
Convert to the iClient features.
Name Type Description featuresol.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 ol.supermap.Feature.Vector The converted iClient features. -
inherited un(event, callback)
Theme.js, line 404 -
Removal of thematic element event listener.
Name Type Description eventstring Name of the event.
callbackRequestCallback event callbacks.