Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(still-image): use the color of the color property for the line color (DEV-210) #580

Merged
merged 2 commits into from Nov 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

}
Expand Down