polygons.ts 1.2 KB

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