|
@@ -11,6 +11,7 @@ import { SPoint, SFont } from '@saga-web/draw/lib';
|
|
|
import { Legend } from '@/lib/types/Legend';
|
|
|
import { uuid } from "@/components/mapClass/until";
|
|
|
import { STextMarkerItem } from '@/lib/items/STextMarkerItem';
|
|
|
+import { SLineMarkerItem } from '@/lib/items/SLineMarkerItem';
|
|
|
|
|
|
/**
|
|
|
* 在线绘图
|
|
@@ -76,7 +77,7 @@ export class EditScence extends SGraphScene {
|
|
|
itemType = 'text'
|
|
|
} else if (obj.itemList[0] instanceof SImageMarkerItem) {
|
|
|
itemType = 'images'
|
|
|
- } else if (obj.itemList[0] instanceof SLineItem) {
|
|
|
+ } else if (obj.itemList[0] instanceof SLineMarkerItem) {
|
|
|
itemType = 'line'
|
|
|
} else if (obj.itemList[0] instanceof SPolylineItem) {
|
|
|
itemType = 'pipeline'
|
|
@@ -105,15 +106,30 @@ export class EditScence extends SGraphScene {
|
|
|
* 增加线段item
|
|
|
*/
|
|
|
addLine(event: SMouseEvent): boolean {
|
|
|
+ const data = {
|
|
|
+ /** ID */
|
|
|
+ ID:'789',
|
|
|
+ /** 名称 */
|
|
|
+ Name: '直线',
|
|
|
+ /** 图标(Image),线类型(Line) */
|
|
|
+ Type: "Line",
|
|
|
+ /** 位置 */
|
|
|
+ Pos: {X: 0, Y: 0},
|
|
|
+ /** 由应用自己定义 */
|
|
|
+ Properties:{
|
|
|
+ Line: [new SPoint(event.x, event.y)]
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- const item = new SLineItem(null, new SPoint(event.x, event.y));
|
|
|
+ const item = new SLineMarkerItem(null, data);
|
|
|
item.status = SItemStatus.Create;
|
|
|
item.zOrder = ItemOrder.lineOrder;
|
|
|
item.selectable = true;
|
|
|
this.addItem(item);
|
|
|
item.connect("finishCreated", this, this.finishCreated);
|
|
|
this.grabItem = item;
|
|
|
- this.undoStack.push(new SGraphAddCommand(this, item));
|
|
|
+ this.Markers.push(item)
|
|
|
+ // this.undoStack.push(new SGraphAddCommand(this, item));
|
|
|
// item.connect("onMove", this, this.onItemMove.bind(this));
|
|
|
return true
|
|
|
}
|