diff --git a/src/atlasComponents/userAnnotations/tools/service.ts b/src/atlasComponents/userAnnotations/tools/service.ts index a80e18c17555fe09ca955d40634a6b0e74ba084e..80a1aa39b4063cce1ae8cbda45760b4d96a842d7 100644 --- a/src/atlasComponents/userAnnotations/tools/service.ts +++ b/src/atlasComponents/userAnnotations/tools/service.ts @@ -20,6 +20,7 @@ import { AnnotationLayer } from "src/atlasComponents/annotations"; import { translateV3Entities } from "src/atlasComponents/sapi/translateV3"; const LOCAL_STORAGE_KEY = 'userAnnotationKey' +const ANNOTATION_LAYER_NAME = "modular_tool_layer_name" type TAnnotationMetadata = { id: string @@ -66,11 +67,11 @@ export class ModularUserAnnotationToolService implements OnDestroy{ static TMP_PREVIEW_ANN_ID = 'tmp_preview_ann_id' static VIEWER_MODE = ARIA_LABELS.VIEWER_MODE_ANNOTATING - static ANNOTATION_LAYER_NAME = 'modular_tool_layer_name' + static USER_ANNOTATION_LAYER_SPEC = { "type": "annotation", "tool": "annotateBoundingBox", - "name": ModularUserAnnotationToolService.ANNOTATION_LAYER_NAME, + "name": ANNOTATION_LAYER_NAME, "annotationColor": "#ee00ff", "annotations": [], } @@ -464,7 +465,7 @@ export class ModularUserAnnotationToolService implements OnDestroy{ throw new Error(`voxelSize of ${this.selectedTmpl.id} cannot be found!`) } this.annotationLayer = new AnnotationLayer( - ModularUserAnnotationToolService.ANNOTATION_LAYER_NAME, + ANNOTATION_LAYER_NAME, ModularUserAnnotationToolService.USER_ANNOTATION_LAYER_SPEC.annotationColor ) this.annotationLayer.onHover.subscribe(val => { diff --git a/src/viewerModule/nehuba/annotation/service.ts b/src/viewerModule/nehuba/annotation/service.ts index fcc109e8f6cc6b81f561e48c42c8123f62107a3e..5822e9ed19763f188b48e58694bfcc88ae48a0be 100644 --- a/src/viewerModule/nehuba/annotation/service.ts +++ b/src/viewerModule/nehuba/annotation/service.ts @@ -5,6 +5,7 @@ import { filter, map, pairwise, startWith } from "rxjs/operators"; import { AnnotationLayer, TNgAnnotationAABBox, TNgAnnotationLine, TNgAnnotationPoint } from "src/atlasComponents/annotations"; import { annotation } from "src/state"; +const ANNOTATION_LAYER_NAME = 'whale-annotation-layer' @Injectable({ providedIn: 'root' @@ -13,7 +14,6 @@ import { annotation } from "src/state"; export class NgAnnotationService implements OnDestroy { private subs: Subscription[] = [] - static ANNOTATION_LAYER_NAME = 'whale-annotation-layer' static INIT_LAYERS: Set<string> = new Set<string>() static COLOR_MAP = new Map<keyof typeof annotation.AnnotationColor, string>([ [annotation.AnnotationColor.WHITE, "#ffffff"], @@ -24,7 +24,7 @@ export class NgAnnotationService implements OnDestroy { static GET_ANN_LAYER(ann: annotation.UnionAnnotation): AnnotationLayer { const color = ann.color || annotation.AnnotationColor.WHITE const layerEnum = annotation.AnnotationColor[color] || annotation.AnnotationColor.WHITE - const layerName = `${NgAnnotationService.ANNOTATION_LAYER_NAME}-${layerEnum}` + const layerName = `${ANNOTATION_LAYER_NAME}-${layerEnum}` const annLayer = AnnotationLayer.Get(layerName, NgAnnotationService.COLOR_MAP.get(color) || "#ffffff") NgAnnotationService.INIT_LAYERS.add(layerName)