|
@@ -15,9 +15,25 @@ import { addRoad } from "../Controls/AddRoad";
|
|
// import { floorplanData } from "../VectorData.js";
|
|
// import { floorplanData } from "../VectorData.js";
|
|
|
|
|
|
export default class UIControl {
|
|
export default class UIControl {
|
|
- constructor(layer) {
|
|
|
|
|
|
+ constructor(layer, newsletter) {
|
|
this.layer = layer;
|
|
this.layer = layer;
|
|
- this.selectUI = null;
|
|
|
|
|
|
+ this.newsletter = newsletter
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ get selectUI() {
|
|
|
|
+ return this.newsletter.selectUI
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ set selectUI(selectUI) {
|
|
|
|
+ this.updateEventNameForSelectUI(selectUI);
|
|
|
|
+ this.newsletter.selectUI = selectUI
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ get selectVector() {
|
|
|
|
+ return this.newsletter.selectVector
|
|
|
|
+ }
|
|
|
|
+ set selectVector(selectVector) {
|
|
|
|
+ this.newsletter.selectVector = selectVector
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -29,8 +45,7 @@ export default class UIControl {
|
|
* 设置选中要操作的UI
|
|
* 设置选中要操作的UI
|
|
*/
|
|
*/
|
|
set currentUI(value) {
|
|
set currentUI(value) {
|
|
- console.log(value);
|
|
|
|
- this.updateEventNameForSelectUI(value);
|
|
|
|
|
|
+ this.selectUI = value
|
|
}
|
|
}
|
|
|
|
|
|
clearUI() {
|
|
clearUI() {
|
|
@@ -39,6 +54,7 @@ export default class UIControl {
|
|
|
|
|
|
//点击左侧栏后,更新事件
|
|
//点击左侧栏后,更新事件
|
|
updateEventNameForSelectUI(selectUI) {
|
|
updateEventNameForSelectUI(selectUI) {
|
|
|
|
+ console.log(this.selectUI, selectUI)
|
|
if (selectUI != null) {
|
|
if (selectUI != null) {
|
|
if (this.selectUI == selectUI) {
|
|
if (this.selectUI == selectUI) {
|
|
return;
|
|
return;
|
|
@@ -48,17 +64,17 @@ export default class UIControl {
|
|
stateService.clear();
|
|
stateService.clear();
|
|
//。。。。
|
|
//。。。。
|
|
}
|
|
}
|
|
- this.selectUI = selectUI;
|
|
|
|
|
|
+ // this.selectUI = selectUI;
|
|
//执行新的事件
|
|
//执行新的事件
|
|
- if (this.selectUI == UIEvents.Road) {
|
|
|
|
|
|
+ if (selectUI == UIEvents.Road) {
|
|
stateService.setEventName(LayerEvents.AddRoad);
|
|
stateService.setEventName(LayerEvents.AddRoad);
|
|
- } else if (this.selectUI == UIEvents.CurveRoad) {
|
|
|
|
|
|
+ } else if (selectUI == UIEvents.CurveRoad) {
|
|
stateService.setEventName(LayerEvents.AddCurveRoad);
|
|
stateService.setEventName(LayerEvents.AddCurveRoad);
|
|
- } else if (this.selectUI == UIEvents.Tag) {
|
|
|
|
|
|
+ } else if (selectUI == UIEvents.Tag) {
|
|
stateService.setEventName(LayerEvents.AddTag);
|
|
stateService.setEventName(LayerEvents.AddTag);
|
|
- } else if (this.selectUI == UIEvents.Img) {
|
|
|
|
|
|
+ } else if (selectUI == UIEvents.Img) {
|
|
stateService.setEventName(LayerEvents.Img);
|
|
stateService.setEventName(LayerEvents.Img);
|
|
- } else if (this.selectUI == UIEvents.AddMeasureLine) {
|
|
|
|
|
|
+ } else if (selectUI == UIEvents.AddMeasureLine) {
|
|
stateService.setEventName(LayerEvents.AddMeasureLine);
|
|
stateService.setEventName(LayerEvents.AddMeasureLine);
|
|
}
|
|
}
|
|
}
|
|
}
|