Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateMinMaxZoomLevelsFromPoiInfo() {
if (this.poiInfo !== undefined) {
if (this.minZoomLevel === undefined) {
this.minZoomLevel = MathUtils.min2(
this.poiInfo.iconMinZoomLevel,
this.poiInfo.textMinZoomLevel
);
}
if (this.maxZoomLevel === undefined) {
this.maxZoomLevel = MathUtils.max2(
this.poiInfo.iconMaxZoomLevel,
this.poiInfo.textMaxZoomLevel
);
}
}
}
}
tiles.forEach(tile => {
minElevation = MathUtils.min2(minElevation, tile.minElevation);
maxElevation = MathUtils.max2(
maxElevation,
tile.maxElevation + tile.maxGeometryHeight
);
});
});
for (const source of [a, b]) {
if (source === undefined) {
continue;
}
for (const sourceInfo of source) {
const existingInfo = result.find(
findItem =>
findItem.id === sourceInfo.id ||
(findItem.label !== undefined && findItem.label === sourceInfo.label)
);
if (existingInfo === undefined) {
result.push({ ...sourceInfo });
} else {
existingInfo.year = MathUtils.max2(sourceInfo.year, existingInfo.year);
existingInfo.label = getOptionValue(sourceInfo.label, existingInfo.label);
existingInfo.link = getOptionValue(sourceInfo.link, existingInfo.link);
}
}
}
return result;
}