| 73 | } |
| 74 | |
| 75 | export class GeoPoly extends Instance implements InstanceInterface { |
| 76 | public bounds: Array<number>; |
| 77 | public bounds_lonlat: Array<number>; |
| 78 | public type: string; |
| 79 | public ol_id: string; |
| 80 | |
| 81 | constructor(type: string) { |
| 82 | super(); |
| 83 | this.type = type; |
| 84 | } |
| 85 | |
| 86 | public create_instance( |
| 87 | id: number, |
| 88 | creation_ref_id: string, |
| 89 | bounds: Array<number>, |
| 90 | bounds_lonlat: Array<number>, |
| 91 | label_file: any, |
| 92 | attribute_groups: any, |
| 93 | soft_delete: boolean = false |
| 94 | ): void { |
| 95 | this.id = id; |
| 96 | this.bounds = bounds; |
| 97 | this.bounds_lonlat = bounds_lonlat; |
| 98 | this.soft_delete = soft_delete; |
| 99 | this.creation_ref_id = creation_ref_id; |
| 100 | this.label_file = label_file; |
| 101 | this.label_file_id = label_file.id; |
| 102 | this.attribute_groups = attribute_groups |
| 103 | } |
| 104 | |
| 105 | public create_frontend_instance( |
| 106 | bounds: Array<number>, |
| 107 | bounds_lonlat: Array<number>, |
| 108 | label_file: any, |
| 109 | ol_id: string, |
| 110 | soft_delete: boolean = false |
| 111 | ): void { |
| 112 | this.bounds = bounds; |
| 113 | this.bounds_lonlat = bounds_lonlat; |
| 114 | this.soft_delete = soft_delete; |
| 115 | this.creation_ref_id = uuidv4(); |
| 116 | this.label_file = label_file; |
| 117 | this.label_file_id = label_file.id; |
| 118 | this.ol_id = ol_id; |
| 119 | } |
| 120 | |
| 121 | public get_instance_data() { |
| 122 | const payload = { |
| 123 | id: this.id || this.creation_ref_id, |
| 124 | type: this.type, |
| 125 | selected: this.selected, |
| 126 | label_file: this.label_file, |
| 127 | label_file_id: this.label_file_id, |
| 128 | soft_delete: this.soft_delete, |
| 129 | creation_ref_id: this.creation_ref_id, |
| 130 | bounds: this.bounds, |
| 131 | bounds_lonlat: this.bounds_lonlat, |
| 132 | ol_id: this.ol_id, |
nothing calls this directly
no outgoing calls
no test coverage detected