Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/components/LayerManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ export default defineComponent({
editingTracks.push(trackFrame);
}
if (editingTracks.length) {
if (editingTrack && !editAnnotationLayer.creationIncomplete()) {
if (editingTrack) {
editAnnotationLayer.checkCreationIncomplete(editingTrack, selectedKey);
editAnnotationLayer.setType(editingTrack);
editAnnotationLayer.setKey(selectedKey);
editAnnotationLayer.changeData(editingTracks);
Expand Down
8 changes: 6 additions & 2 deletions client/src/layers/EditAnnotationLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,13 @@ export default class EditAnnotationLayer extends BaseLayer<GeoJSON.Feature> {
* Provides an indicator that the system is still waiting for creation
* geoJSON data. This is relevant which switching focus while in creation mode
*/
creationIncomplete(): boolean {
checkCreationIncomplete(editingType: EditAnnotationTypes, key: string) {
if (editingType !== this.type || key !== this.selectedKey) {
this.skipNextExternalUpdate = false;
return;
}
const features = this.featureLayer.annotations();
return this.getMode() === 'creation'
this.skipNextExternalUpdate = this.getMode() === 'creation'
&& (!features.length || (features[0] && !features[0].coordinates().length));
}

Expand Down