new zondy.themelayer.rankSymbolThemeLayer(name, symbolType, options)
符号专题图通过为每个要素绘制符号大小来反映其对应的专题值的大小;它只能表示单个个字段属性信息。 符号专题图多用于具有相关数量特征的地图上,比如表示不同地区粮食产量、GDP、人口等。 即通过制作一个符号专题图,就可以清晰展示各个区域相关Value的分布差异等。 目前提供的符号图形有:圆形(后续进行扩展 心形 五角星 多角心 图片等)
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
专题图层名。 |
||||||||||||||||||||
symbolType |
zondy.ChartType |
符号类型。目前支持:"Circle"。 |
||||||||||||||||||||
options |
Object |
参数。
|
Extends
Members
-
symbolSettingObject
-
符号 Circle 配置对象。
Properties:
Name Type Default Description codomainArray 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
maxRnumber 可选 圆形的最大半径。
minRnumber 可选 圆形的最小半径。
fillColorstring 可选 圆形的填充色,如:fillColor: "#FFB980"。
circleStyleObject 可选 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
decimalNumbernumber 可选 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
circleHoverStyleObject 可选 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
circleHoverAbleboolean true 可选 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
circleClickAbleboolean true 可选 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
Events
-
inherited beforefeaturesadded
document/theme/GraphThemeLayer.js, line 78 -
向专题图图层中添加数据之前触发。
Properties:
Name Type Description featuresL.features 待添加的要素。
Methods
-
inherited addFeatures(features)
document/theme/GraphThemeLayer.js, line 71 -
向专题图图层中添加数据。
Name Type Description featuresL.features 待添加的要素。
-
inherited clear()
document/theme/GraphThemeLayer.js, line 501 -
清除图层。清除的内容包括数据(features) 、专题要素、缓存。
-
inherited clearCache(mapPxBounds, chartPxBounds)
document/theme/GraphThemeLayer.js, line 445 -
判断图表是否大小合适,超过地图范围的1/4的不绘制。
Name Type Description mapPxBoundszondy.Bounds 地图像素范围。
chartPxBoundsArray.<Object> 图表范围的四边形节点数组。
例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。 -
createThematicFeature(feature){zondy.Theme}
document/theme/RankSymbolThemeLayer.js, line 55 -
创建专题要素(图形)
Name Type Description featurezondy.Feature.Vector 要创建的专题图形要素
Returns:
Type Description zondy.Theme 专题图形 -
inherited drawCharts()
document/theme/GraphThemeLayer.js, line 193 -
绘制图表。包含压盖处理。
-
inherited getShapesByFeatureID(featureID)
document/theme/GraphThemeLayer.js, line 219 -
通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
Name Type Description featureIDnumber 要素 ID。
-
inherited getWeightFieldValue(feature, weightField, defaultValue)
document/theme/GraphThemeLayer.js, line 515 -
获取权重字段的值。
Name Type Description featurezondy.Feature.Vector 矢量要素。
weightFieldArray.<string> 字段名数组。
defaultValuenumber 当通过 weightField 获取不到权重值时,使用 defaultValue 作为权重值。
-
inherited initialize(name, chartsType, options)
document/theme/GraphThemeLayer.js, line 40 -
初始化。
Name Type Description namestring 专题图名。
chartsTypestring 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
optionsObject 需要设置的参数对象。
-
inherited isChartInMap(mapPxBounds, chartPxBounds)
document/theme/GraphThemeLayer.js, line 398 -
判断图表是否在地图里。
Name Type Description mapPxBoundszondy.Bounds 地图像素范围。
chartPxBoundsArray.<Object> 图表范围的四边形节点数组。 例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
-
inherited isPointInPoly(pt, poly)
document/theme/GraphThemeLayer.js, line 378 -
判断一个点是否在多边形里面。(射线法)
Name Type Description ptObject 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)。
polyArray.<Object> 多边形节点数组。
例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}] -
inherited isQuadrilateralOverLap(rect1, rect2)
document/theme/GraphThemeLayer.js, line 242 -
判断两个四边形是否有压盖。
Name Type Description rect1Array.<Object> 四边形节点数组。
rect2Array.<Object> 第二个四边形节点数组。
Example
[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]; -
inherited lineIntersection(a1, a2, b1, b2){Object}
document/theme/GraphThemeLayer.js, line 330 -
判断两条线段是不是有交点。
Name Type Description a1zondy.geometry.Point 第一条线段的起始节点。
a2zondy.geometry.Point 第一条线段的结束节点。
b1zondy.geometry.Point 第二条线段的起始节点。
b2zondy.geometry.Point 第二条线段的结束节点。
Returns:
Type Description Object 如果相交返回交点,如果不相交返回两条线段的位置关系。 -
inherited redraw()
document/theme/GraphThemeLayer.js, line 491 -
重绘该图层,成功则返回 true,否则返回 false。
-
inherited redrawThematicFeatures(bounds)
document/theme/GraphThemeLayer.js, line 106 -
重绘所有专题要素 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,压盖处理,缓存等步骤。地图漫游时调用此方法进行图层刷新。
Name Type Description boundsL.bounds 重绘的范围。
-
inherited removeAllFeatures()
document/theme/GraphThemeLayer.js, line 481 -
清除当前图层所有的矢量要素。
-
inherited removeFeatures(features)
document/theme/GraphThemeLayer.js, line 469 -
从专题图中删除 feature。这个函数删除所有传递进来的矢量要素(数据)。
Name Type Description featuresObject 待删除的要素。
-
inherited setChartsType(chartsType)
document/theme/GraphThemeLayer.js, line 61 -
设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。图表类型,目前支持:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
Name Type Description chartsTypestring 图表类型。目前可用:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
-
setSymbolType(symbolType)
document/theme/RankSymbolThemeLayer.js, line 45 -
设置符号类型,此函数可动态改变图表类型。在调用此函数前请通过 symbolSetting 为新类型的图表做相关配置。
Name Type Description symbolTypezondy.ChartType 目前支持:"Circle"。