Skip to content
Snippets Groups Projects
Commit 582e5d0e authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: annotation color

parent e6a4b670
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,7 @@ module.exports = {
"'self'",
...userScriptSrc,
'unpkg.com/kg-dataset-previewer@1.2.0/', // preview component
'cdnjs.cloudflare.com/ajax/libs/d3/', // required for preview component
'cdnjs.cloudflare.com/ajax/libs/mathjax/', // math jax
'https://unpkg.com/three-surfer@0.0.11/dist/bundle.js', // for threeSurfer (freesurfer support in browser)
'https://unpkg.com/ng-layer-tune@0.0.5/dist/ng-layer-tune/', // needed for ng layer control
......
......@@ -23,7 +23,8 @@ export class NgAnnotationService implements OnDestroy {
static GET_ANN_LAYER(ann: annotation.UnionAnnotation): AnnotationLayer {
const color = ann.color || annotation.AnnotationColor.WHITE
const layerName = `${NgAnnotationService.ANNOTATION_LAYER_NAME}-${annotation.AnnotationColor[color]}`
const layerEnum = annotation.AnnotationColor[color] || annotation.AnnotationColor.WHITE
const layerName = `${NgAnnotationService.ANNOTATION_LAYER_NAME}-${layerEnum}`
const annLayer = AnnotationLayer.Get(layerName, NgAnnotationService.COLOR_MAP.get(color) || "#ffffff")
NgAnnotationService.INIT_LAYERS.add(layerName)
......@@ -35,6 +36,7 @@ export class NgAnnotationService implements OnDestroy {
const layer = AnnotationLayer.Get(layername, '#ffffff')
layer.dispose()
})
NgAnnotationService.INIT_LAYERS.clear()
while(this.subs.length) this.subs.pop().unsubscribe()
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment