图元
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
|
Example:
var graphic = new Graphic({type:label,style:{text:'mapgis'}});
Members
图元类型
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point |
String |
<optional> |
'point' | 点,类型(type)为point时样式参数参照Style.PointStyle |
label |
String |
<optional> |
'label' | 文本,类型(type)为label时样式参数参照Style.LabelStyle |
billboard |
String |
<optional> |
'billboard' | 广告牌,类型(type)为billboard时样式参数参照Style.BillboardStyle |
polyline |
String |
<optional> |
'polyline' | 线,类型(type)为polyline时样式参数参照Style.PolylineStyle |
polylineVolume |
String |
<optional> |
'polylineVolume' | 圆管线,类型(type)为polylineVolume时样式参数参照Style.PolylineVolumeStyle |
polygon |
String |
<optional> |
'polygon' | 面(区),类型(type)为polygon时样式参数参照Style.PolygonStyle |
rectangle |
String |
<optional> |
'rectangle' | 矩形,类型(type)为rectangle时样式参数参照Style.RectangleStyle |
square |
String |
<optional> |
'square' | 正方形,类型(type)squareStyle.SquareStyle |
circle |
String |
<optional> |
'circle' | 圆,类型(type)为circle时样式参数参照Style.CircleStyle |
corridor |
String |
<optional> |
'corridor' | 方管线,类型(type)为corridor时样式参数参照Style.CorridorStyle |
cylinder |
String |
<optional> |
'cylinder' | 圆台(圆锥),类型(type)为cylinder时样式参数参照Style.CylinderStyle |
ellipsoid |
String |
<optional> |
'ellipsoid' | 椭球,类型(type)为ellipsoid时样式参数参照Style.EllipsoidStyle |
sphere |
String |
<optional> |
'sphere' | 圆球,类型(type)为sphere时样式参数参照Style.SphereStyle |
wall |
String |
<optional> |
'wall' | 墙,类型(type)为wall时样式参数参照Style.WallStyle |
box |
String |
<optional> |
'box' | 盒子,类型(type)为box时样式参数参照Style.BoxStyle |
model |
String |
<optional> |
'model' | gltf模型,类型(type)为model时样式参数参照Style.ModelStyle |
图形对象是否可以选中
图形对象是否阻塞更新,一般设置为false避免更新时闪烁
图形对象属性键值对
readonly boundingSphere : BoundingSphere
图元对象包围盒
coordinate : Array.<Cartesian3>
图形实体位置数组(经纬度+高程,度)
图形对象是否在编辑状态
图形对象偏航角,弧度。
图形ID
图形是否为点,文本或者广告牌
readonly modelMatrix : Matrix4
图元对象旋转平移矩阵
图形对象名称
readonly parentLayer : GraphicsLayer
图元父图层
图形对象俯仰角,弧度。
positions : Array.<Cartesian3>
图形实体位置数组
readonly primitive : Primitive
图形对象primitive
图形对象翻滚角,弧度。
图形是否显示
readonly style : Style
图元对象样式信息
Example:
var graphic = new Graphic({type:label,style:{text:'mapgis'}});
graphic.style.text = 'mapgispro';
图形对象局部坐标系X方向平移量,单位米,X方向为纬线方向
图形对象局部坐标系y方向平移量,单位米,y方向为经线方向
图形对象局部坐标系z方向平移量,单位米,z方向为垂直地表方向
图元类型 参照
Graphic.graphicType
Methods
给图元添加属性字段
Name | Type | Description |
---|---|---|
key |
String | 关键字 |
value |
String | Object | 值 |
添加到图层上,同 layer.addGraphic
Name | Type | Description |
---|---|---|
layer |
GraphicsLayer | 图层对象 |
计算顶点坐标之间的距离
Returns:
返回坐标之间的距离数组
从图层中移除图元