Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
// 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(
extrudedPolygonTechnique.lineColor!,
mapView.zoomLevel
)
);
}
: undefined
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)
);
}
: undefined
);
if (
(isCirclesTechnique(technique) || isSquaresTechnique(technique)) &&
technique.enablePicking !== undefined
) {
// tslint:disable-next-line:max-line-length
(object as MapViewPoints).enableRayTesting = technique.enablePicking!;
}
if (
isLineTechnique(technique) ||
(isSegmentsTechnique(technique) &&
technique.color !== undefined &&
Expr.isExpr(technique.color))
) {
const fadingParams = this.getFadingParams(displayZoomLevel, technique);
FadingFeature.addRenderHelper(
object,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
false,
(renderer, mat) => {
const lineMaterial = mat as THREE.LineBasicMaterial;
lineMaterial.color.set(
getPropertyValue(technique.color, mapView.zoomLevel)
);
}
);
}
if (isSolidLineTechnique(technique)) {
const fadingParams = this.getFadingParams(displayZoomLevel, technique);
);
}
}
this.addFeatureData(srcGeometry, technique, object);
this.addGeometryObjInfos(tile, srcGeometry, technique, object);
if (isExtrudedPolygonTechnique(technique) || isFillTechnique(technique)) {
// filled polygons are normal meshes, and need transparency only when fading or
// dynamic properties is defined.
const hasDynamicColor =
(technique.color !== undefined && Expr.isExpr(technique.color)) ||
(isExtrudedPolygonTechnique(technique) && Expr.isExpr(technique.emissive));
if (technique.fadeFar !== undefined || hasDynamicColor) {
const fadingParams = this.getFadingParams(displayZoomLevel, technique);
FadingFeature.addRenderHelper(
object,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
true,
hasDynamicColor
? (renderer, mat) => {
const polygonMaterial = mat as
| MapMeshBasicMaterial
| MapMeshStandardMaterial;
polygonMaterial.color.set(
getPropertyValue(technique.color!, mapView.zoomLevel)
);
if (
if (outlineTechnique.secondaryCaps !== undefined) {
outlineMaterial.caps = outlineTechnique.secondaryCaps;
}
const outlineObj = new ObjectCtor(bufferGeometry, outlineMaterial);
outlineObj.renderOrder =
outlineTechnique.secondaryRenderOrder !== undefined
? outlineTechnique.secondaryRenderOrder
: technique.renderOrder - 0.0000001;
if (group.renderOrderOffset !== undefined) {
outlineObj.renderOrder += group.renderOrderOffset;
}
const fadingParams = this.getFadingParams(displayZoomLevel, technique);
FadingFeature.addRenderHelper(
outlineObj,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
false,
(renderer, mat) => {
const lineMaterial = mat as SolidLineMaterial;
const unitFactor =
outlineTechnique.metricUnit === "Pixel"
? mapView.pixelToWorld
: 1.0;
if (outlineTechnique.secondaryColor !== undefined) {
lineMaterial.color.set(
getPropertyValue(
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
false,
(renderer, mat) => {
const lineMaterial = mat as THREE.LineBasicMaterial;
lineMaterial.color.set(
getPropertyValue(technique.color, mapView.zoomLevel)
);
}
);
}
if (isSolidLineTechnique(technique)) {
const fadingParams = this.getFadingParams(displayZoomLevel, technique);
FadingFeature.addRenderHelper(
object,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
false,
(renderer, mat) => {
const lineMaterial = mat as SolidLineMaterial;
const unitFactor =
technique.metricUnit === "Pixel" ? mapView.pixelToWorld : 1.0;
if (technique.color !== undefined) {
lineMaterial.color.set(
getPropertyValue(technique.color, mapView.zoomLevel)
);
}