AddRoadStructure.js 901 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { mathUtil } from "../Util/MathUtil";
  2. import { roadStructureService } from "../Service/RoadStructureService";
  3. import { listenLayer } from "../ListenLayer";
  4. export default class AddRoadStructure {
  5. constructor() {
  6. this.newRoadStructure = null;
  7. this.center = null;
  8. this.value = null;
  9. }
  10. // build(position) {
  11. // const roadStructure = uiService.getSelectRoadStructure();
  12. // console.error(roadStructure)
  13. // }
  14. setCenter(value) {
  15. this.center = {};
  16. mathUtil.clonePoint(this.center, value);
  17. }
  18. setValue(value) {
  19. this.value = value;
  20. }
  21. buildRoadStructure(center, type) {
  22. this.newRoadStructure = roadStructureService.create(center, type);
  23. listenLayer.clear();
  24. }
  25. clear() {
  26. this.newRoadStructure = null;
  27. this.center = null;
  28. this.value = null;
  29. }
  30. }
  31. const addRoadStructure = new AddRoadStructure();
  32. export { addRoadStructure };