Text.js 685 B

123456789101112131415161718192021222324252627
  1. import VectorType from "../enum/VectorType.js";
  2. import Geometry from "./Geometry.js";
  3. import { mathUtil } from "../Util/MathUtil.js";
  4. import { coordinate } from "../Coordinate.js";
  5. import Constant from "../Constant.js";
  6. import Style from "@/graphic/CanvasStyle/index.js";
  7. //不靠墙
  8. export default class Text extends Geometry {
  9. constructor(center, vectorId) {
  10. super();
  11. this.center = center;
  12. this.value = "固定点";
  13. this.color = Style.Text.fillStyle;
  14. this.fontSize = Style.Text.fontSize;
  15. this.geoType = VectorType.Text;
  16. this.setId(vectorId);
  17. }
  18. setValue(value) {
  19. this.value = value;
  20. }
  21. setFontSize(value) {
  22. this.fontSize = value;
  23. }
  24. }