Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private static createTextPathGeometries(
geometryData: GeometryData,
techniqueIndex: number,
geometries: GeoJsonTileGeometries
): void {
for (let i = 0; i < geometryData.lines.vertices.length; i++) {
const pathVertex = geometryData.lines.vertices[i];
const path: number[] = [];
path.push(...pathVertex);
const pathLengthSqr = Math2D.computeSquaredLineLength(path);
const properties = geometryData.lines.geojsonProperties[i];
const text = (properties as any)[geometryData.labelProperty!].toString();
const geometry: TextPathGeometry = {
technique: techniqueIndex,
path,
pathLengthSqr,
text,
objInfos: properties
};
geometries.textPathGeometries.push(geometry);
}
}
MAX_CORNER_ANGLE
);
} else {
validLines = worldLines;
}
if (validLines.length === 0) {
continue;
}
if (isTextTechnique(technique)) {
if (text === undefined) {
continue;
}
for (const path of validLines) {
const pathLengthSqr = Math2D.computeSquaredLineLength(path);
this.m_textPathGeometries.push({
technique: techniqueIndex,
path,
pathLengthSqr,
text: String(text),
objInfos: this.m_gatherFeatureAttributes
? env.entries
: getFeatureId(env.entries)
});
}
} else {
const lineMarkerTechnique = technique as LineMarkerTechnique;
let imageTexture = evaluateTechniqueAttr(
context,
lineMarkerTechnique.imageTexture