|
@@ -4,10 +4,11 @@ import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder } from "
|
|
|
import { SGraphItem, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
|
|
|
import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
|
import { TipelineItem } from "@/lib/items/TipelineItem";
|
|
|
-import { SImgTextItem } from "@/lib/items/SImgTextItem"
|
|
|
+import { SImgTextItem } from "@/lib/items/SImgTextItem";
|
|
|
+import { SImageMarkerItem } from "@/lib/items/SImageMarkerItem"
|
|
|
import { SPoint, SFont } from '@saga-web/draw/lib';
|
|
|
import { Legend } from '@/lib/types/Legend';
|
|
|
-import {uuid} from "@/components/mapClass/until"
|
|
|
+import { uuid } from "@/components/mapClass/until"
|
|
|
|
|
|
/**
|
|
|
* 在线绘图
|
|
@@ -149,11 +150,11 @@ export class EditScence extends SGraphScene {
|
|
|
Num: 123
|
|
|
}
|
|
|
const LegendData: Legend = {
|
|
|
- ID:uuid(),
|
|
|
+ ID: uuid(),
|
|
|
Name: this._legend.Name,
|
|
|
GraphElementType: this._legend.Type,
|
|
|
Num: 0,
|
|
|
- GraphElementId:this._legend.Id,
|
|
|
+ GraphElementId: this._legend.Id,
|
|
|
AttachObjectIds: [],
|
|
|
Pos: { x: 0, y: 0 },
|
|
|
OutLine: [[new SPoint(event.x, event.y)]],
|
|
@@ -166,7 +167,7 @@ export class EditScence extends SGraphScene {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- const Polylines = new SZoneLegendItem(null,LegendData);
|
|
|
+ const Polylines = new SZoneLegendItem(null, LegendData);
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
Polylines.setStatus = SItemStatus.Create;
|
|
@@ -185,13 +186,28 @@ export class EditScence extends SGraphScene {
|
|
|
* 增加图片Item
|
|
|
*/
|
|
|
addImgItem(event: SMouseEvent) {
|
|
|
- const url = require('./../../assets/logo.png')
|
|
|
- const item = new SImageItem(null);
|
|
|
- item.url = url;
|
|
|
+ const data = {
|
|
|
+ /** ID */
|
|
|
+ ID:'123',
|
|
|
+ /** 名称 */
|
|
|
+ Name: '嗡嗡嗡',
|
|
|
+ /** 图标(Image),线类型(Line) */
|
|
|
+ Type: 'Image',
|
|
|
+ /** 位置 */
|
|
|
+ Pos: new SPoint(event.x, event.y),
|
|
|
+ /** 由应用自己定义 */
|
|
|
+ Properties:{
|
|
|
+ Url:require('./../../assets/logo.png'),
|
|
|
+ Name: '嗡嗡嗡',
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const item = new SImageMarkerItem(null, data);
|
|
|
+ // item.url = url;
|
|
|
item.zOrder = ItemOrder.imageOrder;
|
|
|
item.selectable = true;
|
|
|
item.moveable = true;
|
|
|
- item.moveTo(event.x, event.y);
|
|
|
+ // item.moveTo(event.x, event.y);
|
|
|
this.addItem(item);
|
|
|
this.grabItem == null;
|
|
|
this.focusItem = item;
|