* _gatherSources * Get the sources used to make the `staging` edit. * @param {string|Object?} annotation - Rapid edits may optionally use an annotation that includes the data source used * @return {Object} sources Object containing `imagery`, `photos`, `data` properties
(annotation)
| 1266 | * @return {Object} sources Object containing `imagery`, `photos`, `data` properties |
| 1267 | */ |
| 1268 | _gatherSources(annotation) { |
| 1269 | const context = this.context; |
| 1270 | const gfx = context.systems.gfx; |
| 1271 | const imagery = context.systems.imagery; |
| 1272 | const photos = context.systems.photos; |
| 1273 | |
| 1274 | const sources = {}; |
| 1275 | const imageryUsed = imagery.imageryUsed(); |
| 1276 | if (imageryUsed.length) { |
| 1277 | sources.imagery = imageryUsed; |
| 1278 | } |
| 1279 | |
| 1280 | const photosUsed = photos.photosUsed(); |
| 1281 | if (photosUsed.length) { |
| 1282 | sources.photos = photosUsed; |
| 1283 | } |
| 1284 | |
| 1285 | const customLayer = gfx.scene.layers.get('custom-data'); |
| 1286 | const customDataUsed = customLayer?.dataUsed() ?? []; |
| 1287 | const rapidDataUsed = annotation?.dataUsed ?? []; |
| 1288 | const dataUsed = [...rapidDataUsed, ...customDataUsed]; |
| 1289 | if (dataUsed.length) { |
| 1290 | sources.data = dataUsed; |
| 1291 | } |
| 1292 | |
| 1293 | return sources; |
| 1294 | } |
| 1295 | |
| 1296 | |
| 1297 | /** |
no test coverage detected