Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getPropertyValue(technique.color!, mapView.zoomLevel)
);
}
: undefined
);
}
}
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(
if (isExtrudedLineTechnique(technique)) {
// extruded lines are normal meshes, and need transparency only when fading or
// dynamic properties is defined.
if (technique.fadeFar !== undefined || Expr.isExpr(technique.color)) {
const fadingParams = this.getFadingParams(
displayZoomLevel,
technique as StandardExtrudedLineTechnique
);
FadingFeature.addRenderHelper(
object,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
true,
technique.color !== undefined && Expr.isExpr(technique.color)
? (renderer, mat) => {
const extrudedMaterial = mat as
| MapMeshStandardMaterial
| MapMeshBasicMaterial;
extrudedMaterial.color.set(
getPropertyValue(technique.color!, mapView.zoomLevel)
);
}
: undefined
);
}
}
this.addFeatureData(srcGeometry, technique, object);
this.addGeometryObjInfos(tile, srcGeometry, technique, object);
);
}
: undefined
);
}
}
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)
getPropertyValue(
technique.gapSize,
mapView.zoomLevel,
mapView.pixelToWorld
) *
unitFactor *
0.5;
}
}
);
}
if (isExtrudedLineTechnique(technique)) {
// extruded lines are normal meshes, and need transparency only when fading or
// dynamic properties is defined.
if (technique.fadeFar !== undefined || Expr.isExpr(technique.color)) {
const fadingParams = this.getFadingParams(
displayZoomLevel,
technique as StandardExtrudedLineTechnique
);
FadingFeature.addRenderHelper(
object,
viewRanges,
fadingParams.fadeNear,
fadingParams.fadeFar,
true,
technique.color !== undefined && Expr.isExpr(technique.color)
? (renderer, mat) => {
const extrudedMaterial = mat as
| MapMeshStandardMaterial
| MapMeshBasicMaterial;
// tileInfo not of expected type [[ExtendedTileInfo]]
return undefined;
}
const widths: RoadIntersectionData["widths"] = [];
widths.length = lineFeatures.numFeatures;
const mapView = this.m_mapView;
for (let i = 0; i < lineFeatures.numFeatures; i++) {
const technique = extendedTileInfo.techniqueCatalog[
lineFeatures.techniqueIndex[i]
] as SolidLineTechnique;
const isDynamic =
technique.metricUnit === "Pixel" ||
Expr.isExpr(technique.lineWidth) ||
typeof technique.lineWidth === "string";
widths[i] =
technique.lineWidth !== undefined
? isDynamic
? () => {
const unitFactor =
technique.metricUnit === "Pixel" ? mapView.pixelToWorld : 1.0;
return (
getPropertyValue(
technique.lineWidth,
mapView.zoomLevel,
mapView.pixelToWorld
) *
unitFactor *
0.5
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
);
if (extrusionAnimationEnabled) {
extrudedObjects.push({
object: edgeObj,
materialFeature: false
});