Skip to content
Permalink
Browse files
feat(still-image): uses the color of the color property for the line …
…color if a color property for the region exists (#580)
  • Loading branch information
mdelez committed Nov 10, 2021
1 parent d19e353 commit 768035399438c3857c2b08ec547483850700bd45
Showing 1 changed file with 10 additions and 1 deletion.
@@ -13,10 +13,11 @@ import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import {
Constants, CreateColorValue, CreateGeomValue, CreateLinkValue,
CreateResource, CreateTextValueAsString, KnoraApiConnection,
Point2D, ReadFileValue,
Point2D, ReadColorValue, ReadFileValue,
ReadGeomValue,
ReadResource,
ReadStillImageFileValue,
ReadValue,
RegionGeometry
} from '@dasch-swiss/dsp-js';
import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens';
@@ -269,6 +270,14 @@ export class StillImageComponent implements OnChanges, OnDestroy {
for (const geom of geometries) {

const geometry = geom.geometry;

const colorValues: ReadColorValue[] = geom.region.properties[Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasColor'] as ReadColorValue[];

// if the geometry has a color property, use that value as the color for the line
if(colorValues && colorValues.length){
geometry.lineColor = colorValues[0].color;
}

this._createSVGOverlay(geom.region.id, geometry, aspectRatio, imageXOffset, geom.region.label);

}

0 comments on commit 7680353

Please sign in to comment.