RankSymbolThemeSource Class

RankSymbolThemeSource(name, symbolType, options)

等级符号专题图图层源。

Fx构造函数

# new RankSymbolThemeSource(name, symbolType, options)

参数:
名称 类型 属性 默认值 描述
name string

专题图层名。

symbolType string

标志类型。

options Object

参数。

map ol.Map

当前 Map 对象。

themeFields string

指定创建专题图字段。

symbolSetting Object

符号 Circle 配置对象 symbolSetting。

symbolSetting.codomain Array.<number>

图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。

symbolSetting.maxR number <optional>

圆形的最大半径。

symbolSetting.minR number <optional>

圆形的最小半径。

symbolSetting.fillColor string <optional>

圆形的填充色,如:fillColor: "#FFB980"。

symbolSetting.circleStyle Object <optional>

圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。

symbolSetting.decimalNumber number <optional>

数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。

symbolSetting.circleHoverStyle Object <optional>

圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。

symbolSetting.circleHoverAble boolean <optional>
true

是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。

symbolSetting.circleClickAble boolean <optional>
true

是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。

id string <optional>

专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。

opacity number <optional>
1

图层透明度。

projection ol.proj.Projection <optional>

投影信息。

ratio number <optional>
1.5

视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。 必须是 1 或更高。

resolutions Array <optional>

分辨率数组。

state ol.source.State <optional>

资源状态。

isOverLay boolean <optional>
true

是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。

查看源代码 openlayers/theme/RankSymbolThemeSource.js, line 5

继承关系

方法

# addFeatures(features)

向专题图图层中添加数据。

参数:
名称 类型 描述
features Object

待添加的要素。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 77

# clear()

清除的内容包括数据(features) 、专题要素、缓存。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 478

# createThematicFeature(feature)

向专题图图层中添加数据, 支持的 feature 类型为:iServer 返回的 feature JSON 对象。

参数:
名称 类型 描述
feature Object

待添加的要素。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 159

# destroy()

释放资源,将引用资源的属性置空。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 51

# destroyFeatures(features)

销毁某个要素。

参数:
名称 类型 描述
features Zondy.Feature.Vector

将被销毁的要素。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 126

# drawCharts()

绘制图表。包含压盖处理。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 180

# fire(type, event)

添加专题要素事件监听。

参数:
名称 类型 描述
type string

事件类型。

event string

事件名称。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 342

# getFeatureBy(property, value) → {Zondy.Feature.Vector}

在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时, 返回此 feature(并且只返回第一个)。

参数:
名称 类型 描述
property string

feature 的某个属性名称。

value string

property 所对应的值。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 265

第一个匹配属性和值的矢量要素。

Zondy.Feature.Vector

# getFeatureById(featureId) → {Zondy.Feature.Vector}

通过给定一个 ID,返回对应的矢量要素。

参数:
名称 类型 描述
featureId string

矢量要素的属性 ID。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 285

对应 ID 的 feature,如果不存在则返回 null。

Zondy.Feature.Vector

# getFeatures() → {Zondy.Feature.Vector}

查看当前图层中的有效数据。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 250

用户加入图层的有效数据。

Zondy.Feature.Vector

# getFeaturesByAttribute(attrName, attrValue) → {Array.<Zondy.Feature.Vector>}

通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。

参数:
名称 类型 描述
attrName string

属性的 key。

attrValue string

矢量要素的属性 ID。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 295

一个匹配的 feature 数组。

Array.<Zondy.Feature.Vector>

# getLocalXY(coordinate)

获取坐标系统。

参数:
名称 类型 描述
coordinate Object

坐标位置。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 447

# getShapesByFeatureID(featureID)

通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。

参数:
名称 类型 描述
featureID number

要素 ID。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 292

# isChartInMap(mapPxBounds, chartPxBounds)

判断图表是否在地图里。

参数:
名称 类型 描述
mapPxBounds Zondy.Bounds

地图像素范围。

chartPxBounds Array.<Object>

图表范围的四边形节点数组。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 417

# isPointInPoly(pt, poly)

判断一个点是否在多边形里面。(射线法)。

参数:
名称 类型 描述
pt Object

需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。

poly Array.<Object>

多边形节点数组。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 402

# lineIntersection(a1, a2, b1, b2) → {Object}

判断两条线段是不是有交点。

参数:
名称 类型 描述
a1 Zondy.Geometry.Point

第一条线段的起始节点。

a2 Zondy.Geometry.Point

第一条线段的结束节点。

b1 Zondy.Geometry.Point

第二条线段的起始节点。

b2 Zondy.Geometry.Point

第二条线段的结束节点。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 355

如果相交返回交点,如果不相交返回两条线段的位置关系。

Object

# on(event, callback)

添加专题要素事件监听。支持的事件包括: click、mousedown、mousemove、mouseout、mouseover、mouseup。

参数:
名称 类型 描述
event string

事件名称。

callback RequestCallback

事件回调函数。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 324

# redrawThematicFeatures(extent)

重绘所有专题要素。 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。 地图漫游时调用此方法进行图层刷新。

参数:
名称 类型 描述
extent Object

重绘的范围。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 115

# removeFeatures(features)

从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。

参数:
名称 类型 描述
features Zondy.Feature.Vector

要删除的要素。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 446

# rotate(pixelP, rotation, center)

获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。

参数:
名称 类型 描述
pixelP number

像素坐标点位置。

rotation number

旋转角度。

center number

中心位置。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 474

# scale(pixelP, center, scaleRatio) → {Array.<number>}

获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。

参数:
名称 类型 描述
pixelP Object

像素点。

center Object

中心点。

scaleRatio number

缩放倍数。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 487

返回数组形比例

Array.<number>

# setChartsType(chartsType)

设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。

参数:
名称 类型 描述
chartsType string

图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。

Inherited From:

查看源代码 openlayers/theme/GraphThemeSource.js, line 67

# setOpacity(opacity)

设置图层的不透明度,取值[0-1]之间。

参数:
名称 类型 描述
opacity number

不透明度。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 145

# un(event, callback)

移除专题要素事件监听。

参数:
名称 类型 描述
event string

事件名称。

callback RequestCallback

事件回调函数。

Inherited From:

查看源代码 openlayers/theme/ThemeSource.js, line 409