Point.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import VectorType from "../enum/VectorType.js";
  2. import VectorCategory from "../enum/VectorCategory.js";
  3. import Geometry from "./Geometry";
  4. import Settings from "../Settings";
  5. export default class Point extends Geometry {
  6. constructor(position, vectorId) {
  7. super();
  8. this.x = null;
  9. this.y = null;
  10. this.parent = {};
  11. this.linkedBasePointId = null; //关联基准点
  12. this.locationMode = null; //如果该点是待测点,采用的定位法是哪种
  13. this.linkedTextId = null; //固定点,关联文本
  14. this.category = Settings.selectPointCategory;
  15. this.geoType = VectorType.Point;
  16. this.setId(vectorId);
  17. this.setPosition(position);
  18. }
  19. setPosition(position) {
  20. this.x = position.x;
  21. this.y = position.y;
  22. }
  23. getLinkedBasePointId() {
  24. return this.linkedBasePointId;
  25. }
  26. setLinkedBasePointId(pointId) {
  27. this.linkedBasePointId = pointId;
  28. }
  29. //基准点:BasePoint
  30. setCategory(value) {
  31. if (!value) {
  32. this.category = Settings.selectPointCategory;
  33. } else {
  34. this.category = value;
  35. }
  36. }
  37. }