MCPcopy
hub / github.com/diffgram/diffgram / GeoCircle

Class GeoCircle

frontend/src/components/vue_canvas/instances/GeoInstance.ts:5–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import { InstanceInterface } from "../../../helpers/interfaces/InstanceData";
4
5export class GeoCircle extends Instance implements InstanceInterface {
6 public type: string = "geo_circle";
7 public lonlat: Array<number>;
8 public coords: Array<number>;
9 public radius: number;
10 public ol_id: string;
11
12 constructor() {
13 super();
14 }
15
16 public create_instance(
17 id: number,
18 creation_ref_id: string,
19 lonlat: Array<number>,
20 coords: Array<any>,
21 radius: number,
22 label_file: any,
23 attribute_groups: any,
24 soft_delete: boolean = false
25 ): void {
26 this.id = id
27 this.lonlat = lonlat;
28 this.coords = coords;
29 this.radius = radius;
30 this.soft_delete = soft_delete;
31 this.creation_ref_id = creation_ref_id;
32 this.label_file = label_file;
33 this.label_file_id = label_file.id;
34 this.attribute_groups = attribute_groups
35 }
36
37 public create_frontend_instance(
38 lonlat: Array<number>,
39 coords: Array<any>,
40 radius: number,
41 label_file: any,
42 ol_id: string,
43 soft_delete: boolean = false
44 ): void {
45 this.lonlat = lonlat;
46 this.coords = coords;
47 this.radius = radius;
48 this.soft_delete = soft_delete;
49 this.creation_ref_id = uuidv4();
50 this.label_file = label_file;
51 this.label_file_id = label_file.id;
52 this.ol_id = ol_id;
53 }
54
55 public get_instance_data() {
56 const payload = {
57 id: this.id || this.creation_ref_id,
58 type: this.type,
59 selected: this.selected,
60 label_file: this.label_file,
61 label_file_id: this.label_file_id,
62 soft_delete: this.soft_delete,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected