Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const lineTechnique = poiInfo.technique as LineMarkerTechnique;
const minDistanceSqr =
lineTechnique.minDistance !== undefined
? lineTechnique.minDistance * lineTechnique.minDistance
: 0;
// Process markers (with shield groups).
if (minDistanceSqr > 0 && shieldGroup !== undefined) {
for (let pointIndex = 0; pointIndex < path.length; ++pointIndex) {
const point = path[pointIndex];
// Only process labels frustum-clipped labels
if (this.m_screenProjector.project(point, tempScreenPosition) !== undefined) {
// Find a suitable location for the lineMarker to be placed at.
let tooClose = false;
for (let j = 0; j < shieldGroup.length; j += 2) {
const distanceSqr = Math2D.distSquared(
shieldGroup[j],
shieldGroup[j + 1],
tempScreenPosition.x,
tempScreenPosition.y
);
tooClose = distanceSqr < minDistanceSqr;
if (tooClose) {
break;
}
}
// Place it as a point label if it's not to close to other marker in the
// same shield group.
if (!tooClose) {
if (
this.addPointLabel(