# EntityFactory
创建 Entity
# 加载方式
let entity = GeowayGlobe.EntityFactory.create("POLYGON", {
dataSource: {
positions: [
[113.56, 32.55, 10000],
[115.56, 25.55, 10000],
[117.56, 47.55, 10000],
[113.56, 32.55, 10000],
],
},
style: {
strokeColor: "#00ff00",
fillColor: "#ff0000",
},
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# EntityFactory options 构造属性
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
EntityType | entity 类型 | String | '' |
option | entity 实体的样式(填充色,线颜色等) | String | '' |
其中EntityType具体类型如下所示:
Point: "POINT", //点
Polyline: "POLYLINE",//线
PolylineVolume: "POLYLINEVOLUME",//管道
Polygon: "POLYGON",//面
Rect: "RECT",//矩形
Plane: "PLANE",//面
Dashline: "DASHLINE", //虚线
DashCircle: "DASHCIRCLE",//虚线圆
Circle: "CIRCLE",//圆
CircleRing: "CIRCLERING",//圆环
Marker_Broken_Line: "MARKER_BROKEN_LINE",//标记折线
ImagePolyline: "IMAGEPOLYLINE",//图片线
Label: "LABEL",//标签
LabelImage:"LABELIMAGE",//图片标签
RoamingLine:"ROAMING_LINE",//漫游线
MarkerRadarScan:"MARKER_RADAR_SCAN",//雷达扫描
PolylineCircle:"POLYLINE_CIRCLE"//多段线圆
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
其中 option 下面具体参数如下所示:
1. dataSource 存放 Entity 的位置信息
如 dataSource: {
positions: [
[113.56, 32.55, 10000],
[115.56, 25.55, 10000],
[117.56, 47.55, 10000],
[113.56, 32.55, 10000],
],
},
2. radius 半径
3. width 宽度
4. fillColor 填充的颜色
5. strokeColor 描边的颜色
6. strokeAlpha 描边透明度
7. heightReference 相对于地形的位置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16