Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Read the uniforms from the technique values (and apply the default values).
const extrudedPolygonTechnique = technique as ExtrudedPolygonTechnique;
const fadingParams = this.getPolygonFadingParams(
displayZoomLevel,
extrudedPolygonTechnique
);
// Configure the edge material based on the theme values.
const materialParams: EdgeMaterialParameters = {
color: fadingParams.color,
colorMix: fadingParams.colorMix,
fadeNear: fadingParams.lineFadeNear,
fadeFar: fadingParams.lineFadeFar
};
const edgeMaterial = new EdgeMaterial(materialParams);
const edgeObj = new THREE.LineSegments(edgeGeometry, edgeMaterial);
// Set the correct render order.
edgeObj.renderOrder = object.renderOrder + 0.1;
FadingFeature.addRenderHelper(
edgeObj,
viewRanges,
fadingParams.lineFadeNear,
fadingParams.lineFadeFar,
false,
extrudedPolygonTechnique.lineColor !== undefined &&
Expr.isExpr(extrudedPolygonTechnique.lineColor)
? (renderer, mat) => {
edgeMaterial.color.set(
getPropertyValue(
const fillTechnique = technique as FillTechnique;
const fadingParams = this.getPolygonFadingParams(
displayZoomLevel,
fillTechnique
);
// Configure the edge material based on the theme values.
const materialParams: EdgeMaterialParameters = {
color: fadingParams.color,
colorMix: fadingParams.colorMix,
fadeNear: fadingParams.lineFadeNear,
fadeFar: fadingParams.lineFadeFar
};
const outlineMaterial = new EdgeMaterial(materialParams);
const outlineObj = new THREE.LineSegments(outlineGeometry, outlineMaterial);
outlineObj.renderOrder = object.renderOrder + 0.1;
FadingFeature.addRenderHelper(
outlineObj,
viewRanges,
fadingParams.lineFadeNear,
fadingParams.lineFadeFar,
false,
fillTechnique.lineColor !== undefined &&
Expr.isExpr(fillTechnique.lineColor)
? (renderer, mat) => {
const edgeMaterial = mat as EdgeMaterial;
edgeMaterial.color.set(
getPropertyValue(fillTechnique.lineColor!, mapView.zoomLevel)
);