| 138 | } |
| 139 | |
| 140 | export class GeoPoint extends Instance implements InstanceInterface { |
| 141 | public lonlat: Array<number>; |
| 142 | public coords: Array<number>; |
| 143 | public type: string = "geo_point"; |
| 144 | public ol_id: string; |
| 145 | |
| 146 | constructor() { |
| 147 | super(); |
| 148 | } |
| 149 | |
| 150 | public create_instance( |
| 151 | id: number, |
| 152 | creation_ref_id: string, |
| 153 | lonlat: Array<number>, |
| 154 | coords: Array<number>, |
| 155 | label_file: any, |
| 156 | attribute_groups: any, |
| 157 | soft_delete: boolean = false |
| 158 | ): void { |
| 159 | this.id = id; |
| 160 | this.lonlat = lonlat; |
| 161 | this.coords = coords; |
| 162 | this.soft_delete = soft_delete; |
| 163 | this.creation_ref_id = creation_ref_id; |
| 164 | this.label_file = label_file; |
| 165 | this.label_file_id = label_file.id; |
| 166 | this.attribute_groups = attribute_groups; |
| 167 | } |
| 168 | |
| 169 | public create_frontend_instance( |
| 170 | lonlat: Array<number>, |
| 171 | coords: Array<number>, |
| 172 | label_file: any, |
| 173 | ol_id: string, |
| 174 | soft_delete: boolean = false |
| 175 | ): void { |
| 176 | this.lonlat = lonlat; |
| 177 | this.coords = coords; |
| 178 | this.soft_delete = soft_delete; |
| 179 | this.creation_ref_id = uuidv4(); |
| 180 | this.label_file = label_file; |
| 181 | this.label_file_id = label_file.id; |
| 182 | this.ol_id = ol_id; |
| 183 | } |
| 184 | |
| 185 | public get_instance_data() { |
| 186 | const payload = { |
| 187 | id: this.id || this.creation_ref_id, |
| 188 | type: this.type, |
| 189 | selected: this.selected, |
| 190 | label_file: this.label_file, |
| 191 | label_file_id: this.label_file_id, |
| 192 | soft_delete: this.soft_delete, |
| 193 | creation_ref_id: this.creation_ref_id, |
| 194 | lonlat: this.lonlat, |
| 195 | coords: this.coords, |
| 196 | ol_id: this.ol_id, |
| 197 | attribute_groups: this.attribute_groups |
nothing calls this directly
no outgoing calls
no test coverage detected