Point.js 529 B

1234567891011121314151617181920212223242526
  1. import VectorType from "../enum/VectorType.js";
  2. import Geometry from "./Geometry";
  3. export default class Point extends Geometry {
  4. constructor(position, vectorId) {
  5. super();
  6. this.x = null;
  7. this.y = null;
  8. this.parent = {};
  9. this.category = null;
  10. this.geoType = VectorType.Point;
  11. this.setId(vectorId);
  12. this.setPosition(position);
  13. }
  14. setPosition(position) {
  15. this.x = position.x;
  16. this.y = position.y;
  17. }
  18. //基准点:BasePoint
  19. setCategory(value) {
  20. this.category = value;
  21. }
  22. }