|
@@ -6,7 +6,8 @@ import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
|
import { TipelineItem } from "@/lib/items/TipelineItem";
|
|
|
import { SImgTextItem } from "@/lib/items/SImgTextItem"
|
|
|
import { SPoint, SFont } from '@saga-web/draw/lib';
|
|
|
-
|
|
|
+import { Legend } from '@/lib/types/Legend';
|
|
|
+import {uuid} from "@/components/mapClass/until"
|
|
|
|
|
|
/**
|
|
|
* 在线绘图
|
|
@@ -54,7 +55,14 @@ export class EditScence extends SGraphScene {
|
|
|
// // 选择绑定选额item事件
|
|
|
this.selectContainer.connect("listChange", this, this.listChange);
|
|
|
}
|
|
|
-
|
|
|
+ /** 绘制图例样式 */
|
|
|
+ _legend: any | null = null;
|
|
|
+ get getlegend(): any {
|
|
|
+ return this._legend;
|
|
|
+ };
|
|
|
+ set setlegend(obj: any) {
|
|
|
+ this._legend = obj;
|
|
|
+ }
|
|
|
/**
|
|
|
* 监听变化
|
|
|
* @param obj 变化后的对象
|
|
@@ -130,7 +138,6 @@ export class EditScence extends SGraphScene {
|
|
|
addPolygonItem(event: SMouseEvent): void {
|
|
|
//创建item
|
|
|
const Legend = {
|
|
|
- ID: 123,
|
|
|
Name: "哈哈",
|
|
|
GraphElementType: 'Zone',
|
|
|
GraphElementId: '123',
|
|
@@ -142,8 +149,25 @@ export class EditScence extends SGraphScene {
|
|
|
},
|
|
|
Num: 123
|
|
|
}
|
|
|
+ const LegendData: Legend = {
|
|
|
+ ID:uuid(),
|
|
|
+ Name: this._legend.Name,
|
|
|
+ GraphElementType: this._legend.Type,
|
|
|
+ Num: 0,
|
|
|
+ GraphElementId:this._legend.Id,
|
|
|
+ AttachObjectIds: [],
|
|
|
+ Pos: { x: 0, y: 0 },
|
|
|
+ OutLine: [[new SPoint(event.x, event.y)]],
|
|
|
+ Scale: { X: 1, Y: 1, Z: 1 }, // 缩放
|
|
|
+ Rolate: { X: 0, Y: 0, Z: 0 },
|
|
|
+ Size: { Width: 0, Height: 0 }, // 大小
|
|
|
+ Properties: {
|
|
|
+ strokeColor: this._legend.Color,
|
|
|
+ fillColor: this._legend.FillColor,
|
|
|
+ },
|
|
|
+ }
|
|
|
|
|
|
- const Polylines = new SZoneLegendItem(null, Legend);
|
|
|
+ const Polylines = new SZoneLegendItem(null,LegendData);
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
Polylines.setStatus = SItemStatus.Create;
|