polygons.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { PolygonsAttrib } from "drawing-board";
  2. import { ref } from "vue";
  3. export type Polygons = PolygonsAttrib;
  4. export type {
  5. PolygonsLineAttrib as LineAttrib,
  6. PolygonsPointAttrib as PontAttrib,
  7. } from "drawing-board";
  8. export const polygons = ref<Polygons>({
  9. id: "0",
  10. lines: [],
  11. polygons: [],
  12. points: [],
  13. });
  14. setTimeout(() => {
  15. polygons.value = {
  16. id: "0",
  17. lines: [
  18. { id: "1", pointIds: ["2666", "2667"] },
  19. { id: "2", pointIds: ["2667", "2669"] },
  20. ],
  21. polygons: [{ id: "1", lineIds: ["1", "2"] }],
  22. points: [
  23. { rtk: false, x: 115.949835199646, y: 30.0971239995873, id: "2666" },
  24. { rtk: false, x: 115.949706558269, y: 30.0975243383135, id: "2667" },
  25. { rtk: false, x: 115.950002555619, y: 30.0977552558535, id: "2668" },
  26. { rtk: false, x: 115.949968744193, y: 30.097862045865, id: "2669" },
  27. { rtk: true, x: 115.950063977564, y: 30.0978879318173, id: "2670" },
  28. { rtk: true, x: 115.949964417593, y: 30.0978650571868, id: "2671" },
  29. { rtk: true, x: 115.950300839723, y: 30.0976756336231, id: "2672" },
  30. { rtk: true, x: 115.950437426448, y: 30.097269657442, id: "2673" },
  31. ],
  32. };
  33. }, 2000);