new SuperMap.Feature.ShapeParameters()
Classes
Members
-
clickableboolean
-
It is clickable or not.
-
dataInfoObject
-
The additional data with shape.
-
highlightStyleObject
-
The highlight style object can be set with the same style properties as the style's set style properties.
-
hoverableboolean
-
It is hoverable or not.
-
isHoverByRefDataIDboolean
-
Whether to highlight in accordance with refDataID. It is used to highlight all geometries with the same refDataID.
-
refDataHoverGroupstring
-
The group name of highlight geometries. It is valid only when refDataID is valid and isHoverByRefDataID is true. Once the property is set and is valid, geometries associated with the same data and has the same property can be highlighted.
-
refDataIDstring
-
Data ID associated with shape.(<
SuperMap.Feature.Vector> ID)。 -
refOriginalPositionArray
-
Shape's reference original position, shape's reference center position. refOriginalPosition is an array, the first element represents x coordinate, and the second element represents y coordinate.
refOriginalPosition represents shape's reference center. In general, the origin of canvas is the reference position. But you can change the reference position by refOriginalPosition. e.g. refOriginalPosition = [80, 80], circle style.x = 20, style.y = 20, so the real position of the circle in canvas is [100, 100].
All position properties of shape is based on the reference center of refOriginalPosition. In other words, the position of shape in canvas is relative position on the basis of refOriginalPosition. Only when refOriginalPosition is [0, 0], the shape position is the absolute position of canvas.
The information of shape position has:style.pointList,style.x,style.y。
refOriginalPosition. The default value is [0, 0].
- Default Value: [0,0]
shapeParametersObject
Shape parameter object,<SuperMap.Feature.ShapeParameters> child class object. Optional.
styleObject
The style object of the shape.Set style properties in subclasses.
Methods
-
Background(shapeFactory, box, setting){Object}
ShapeFactory.js, line 373 -
Create a shape object with rectangle background.
Name Type Description shapeFactorySuperMap.Feature.ShapeFactory Shape factory object. Required.
boxArray.<number> Box area. It is an array of length 4, pixel coordinates, [left, bottom, right, top]. Required.
settingObject Shape configure parameter. Required.
Name Type Default Description backgroundStyleObject Background style whose object's available property: <SuperMap.Feature.ShapeParameters.Rectangle::style>.
backgroundRadiusArray [0,0,0,0] optional The rectangular rounded corners of the background box can be defined by 4 radius: upper left, upper right, lower right, lower left, i.e., [r1, r2, r3, r4].The default backgroundRadius is [0, 0, 0, 0].
Returns:
Type Description Object Background box shape, which is a visible shape (rectangle) object. -
constructor(){SuperMap.Feature.ShapeParameters}
ShapeParameters.js, line 11 -
The shape parameter object.
Returns:
Type Description SuperMap.Feature.ShapeParameters The shape parameter object. -
createShape(shapeParameters){Object}
ShapeFactory.js, line 66 -
Create a shape. The specific shape is determined by shapeParameters.
Name Type Description shapeParametersObject Shape parameter object,<
SuperMap.Feature.ShapeParameters> child class object. Optional. If using the parameter which isn't null, shapeParameters will be assigned to the parameter value, and then use shapeParameters to create a shape; If not using this parameter, the createShape method will directly use shapeParameter to create the shape.Returns:
Type Description Object Shape object (or null - failed to create the shape) -
destroy()
ShapeParameters.js, line 89 -
Destroy objects。
-
destroy()
ShapeParameters.js, line 89 -
Destroy objects。
-
GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo){Array.<Object>}
ShapeFactory.js, line 411 -
Create a shape object array with graph axis.
Name Type Description shapeFactorySuperMap.Feature.ShapeFactory Shape factory object. Required.
dataViewBoxArray.<number> The data view box for the graph pattern. It is an array of length 4, pixel coordinates, [left, bottom, right, top]. Required.
settingObject Shape configure parameter. Required.
Name Type Default Description axisStyleObject The shape object in the s direction has 2 properties:
axisUseArrowboolean false optional Whether the axis uses arrow. The default is false, which means not using arrow.
axisYTicknumber 0 optional y axis tick. Default is 0 which means tick isn't used.
axisYLabelsArray.<string> The label array contents on the y axis. The label order is listed equally interval from top to down along the left data view box. e.g.:["1000", "750", "500", "250", "0"].
axisYLabelsStyleObject The label array style on the y axis. The style object's available property: <SuperMap.Feature.ShapeParameters.Label::style>.
axisYLabelsOffsetArray.<number> [0,0] optional The label array offset on the y axis. It is an array of 2 length. The first element is the horizontal offset for the y label array, positive to left, default is 0;
axisXLabelsArray.<string> The label array contents on the x axis. The label order is listed equally interval from top to down along the bottom data view box. e.g.:["92", "95", "99"]. the second element is the vertical offset for the y label array, positive to down, default is 0.
axisXLabelsStyleObject The label array style on the x axis. The style object's available property: <SuperMap.Feature.ShapeParameters.Label::style>.
axisXLabelsOffsetArray.<number> [0,0] optional The label array offset on the x axis. It is an array of 2 length. The first element is the horizontal offset for the x label array, positive to left, default is 0;
useXReferenceLineboolean Whether to use horizontal reference line. If ture, it is valid when axisYTick is greater than 0. The horizontal reference line is an extended line in the data view box along the y axis scale.
xReferenceLineStyleObject Horizontal reference line style style whose object's available property: <SuperMap.Feature.ShapeParameters.Line::style>.
axis3DParameternumber 0 optional 3D coordinate parameter. This property is available only when the value is greater than or equal to 15. The default is 0.
xShapeInfoObject The shape object in the s direction has 2 properties:
Name Type Description xPositionsArray.<number> Represent pixel coordinates in x direction. If the shape has certain width in the x direction, the center point for the x direction for the shape will be regarded as the x coordinate value.
widthnumber Represent the shape width (Note that the width of the point is always 0, it isn't a radius).
Returns:
Type Description Array.<Object> A shape object array with graph axis. -
ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value){Object}
ShapeFactory.js, line 756 -
A shape style tool. This tool helps to get the final merged style from the default style, common style, style by styleGroup and style by value.
Name Type Description defaultStyleObject Default style. The style object available property is based on shape type reference <SuperMap.Feature.ShapeParameters> child object style property.
styleObject Shape basic style. This parameter controls shape's basic style. The available property is based on shape type reference <SuperMap.Feature.ShapeParameters> child object style property. The priority is lower than styleGroup, styleByCodomain.
styleGroupArray.<Object> Each element of the array is style object whos available property is based on shape type reference <SuperMap.Feature.ShapeParameters> child object style property. Style is obtained from styleGroup via index.
styleByCodomainArray.<Object> Control data visible style according to the threshold range (parameter value). (start code) // styleByCodomain Each element is an object containing information and domain and range corresponding to the style information, the object has three properties (must): // start: range lower limit (included); // end: range upper limit (not included); // style: Data visualization graphics style, this style object can be set properties: <SuperMap.Feature.ShapeParameters.Polygon::style>. // dataStyleByCodomain array like: [ { start:0, end:250, style:{ fillColor:"#00CD00" } }, { start:250, end:500, style:{ fillColor:"#00EE00" } }, { start:500, end:750, style:{ fillColor:"#00FF7F" } }, { start:750, end:1500, style:{ fillColor:"#00FF00" } } ] (end)
indexnumber styleGroup index, which is used to get the style from styleGroup.
valuenumber Value, which is used to get the style from styleByCodomain.
Returns:
Type Description Object The style object after merged. -
transformStyle(style){Object}
ShapeFactory.js, line 260 -
Transform the format of the user feature.style(the SVG style class) to the format standard (the CSS-Canvas class) of the levelRenderer
Name Type Description styleObject user style.
Returns:
Type Description Object the style conforming to the levelRenderer.