Dot
是用于创建3D散点图的类,散点图用以展示海量的独立数据点。
构造函数
构造函数 |
---|
TMap.visualization.Dot(options:DotOptions)
|
方法
方法 | 返回值 | 说明 |
---|---|---|
setStyles(styles: Object)
|
this
|
设置样式集合,styles为key-value形式。key对应数据中的styleId,value为样式对象,需符合DotCircleStyle或DotImageStyle对象规范。 |
setFaceTo(faceTo: String)
|
this
|
设置散点朝向,可取map(贴地)或screen(直立)。 |
setData(dataList:DotPoint[])
|
this
|
设置数据。 |
addTo(map:Map)
|
this
|
添加至指定地图实例。 |
show()
|
this
|
显示图层。 |
hide()
|
this
|
隐藏图层。 |
remove()
|
this
|
从地图中删除图层。 |
destroy()
|
this
|
销毁图层对象。 |
事件
事件名 | 参数 | 说明 |
---|---|---|
click
|
evt:VisualEvent
|
点击散点时触发。 |
hover
|
evt:VisualEvent
|
鼠标悬停目标改变时触发,若悬停在图形外部,则返回结果中的拾取对象为null |
CircleDotStyle
散点图圆形样式规范。
属性
名称 | 类型 | 说明 |
---|---|---|
type
|
String
|
取值为circle。 |
fillColor
|
String
|
圆形样式属性,填充颜色,支持rgb(),rgba(), #RRGGBB格式,默认为rgba(56,124,234,0.75) |
strokeColor
|
String
|
圆形样式属性,边线颜色,支持rgb(),rgba(), #RRGGBB格式。 |
strokeWidth
|
Number
|
圆形样式属性,边线宽度,不可为负数,默认为0(px)。 |
radius
|
Number
|
圆形样式属性,圆形半径,不可为负数,默认为4(px)。 |
ImageDotStyle
散点图图片样式规范。
属性
名称 | 类型 | 说明 |
---|---|---|
type
|
String
|
取值为image。 |
width
|
Number
|
图片样式属性,图片显示宽度,不可为负数,默认为10(px)。 |
height
|
Number
|
图片样式属性,图片显示高度,不可为负数,默认为10(px) |
anchor
|
Object
|
图片的锚点位置,对象字面量{x:Number, y:Number}形式,以图片左上角为原点,x轴向右为正,y轴向下为正,默认为{ x: width/2, y: height/2 },即图片中心点。 |
src
|
String
|
图片样式属性,图片url或base64地址。 |