Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private initOverrides(): FeatureSymbology.Overrides {
const ovrs = new FeatureSymbology.Overrides(this.viewport);
ovrs.neverDrawn.clear();
ovrs.alwaysDrawn.clear();
ovrs.setAlwaysDrawnSet(this.changedElems.deleted, true, false); // really "only-drawn" - only draw our deleted elements - unless their subcategory is turned off.
const red = ColorDef.from(0xff, 0, 0, changedTransparency);
ovrs.setDefaultOverrides(FeatureSymbology.Appearance.fromRgba(red));
return ovrs;
}
public createOverrideKey(color: ColorDef, override: FeatureOverrideType): number | undefined {
const colorValues = color.colors;
switch (override) {
case FeatureOverrideType.ColorAndAlpha:
return 255 === colorValues.t ? undefined : color.tbgr; // Hiding elements should be done using neverDrawn, not transparency...
case FeatureOverrideType.ColorOnly:
return ColorDef.from(colorValues.r, colorValues.g, colorValues.b, 255).tbgr;
case FeatureOverrideType.AlphaOnly:
return -(colorValues.t / 255);
}
}
protected colorDefFromMaterialJson(json: any): ColorDef | undefined {
return undefined !== json ? ColorDef.from(json[0] * 255 + 0.5, json[1] * 255 + 0.5, json[2] * 255 + 0.5) : undefined;
}
protected colorDefFromMaterialJson(json: any): ColorDef | undefined {
return undefined !== json ? ColorDef.from(json[0] * 255 + 0.5, json[1] * 255 + 0.5, json[2] * 255 + 0.5) : undefined;
}