fix(tactical): remove label spam on terrain grid, refine realistic cliff gradient >= 28 deg, and soften overlay opacities

This commit is contained in:
Hamza-Ayed
2026-08-18 11:43:28 +03:00
parent c35f6e61f2
commit ba2f211438
2 changed files with 80 additions and 38 deletions
+39 -12
View File
@@ -837,11 +837,11 @@ export async function calculateTerrainStudy(
const p4 = [p4Coord.lng, p4Coord.lat];
// Military Grade Slope & Barrier Classification:
// - Flat (GO): < 7°
// - Rolling (SLOW-GO): 7° - 15°
// - Rugged / Steep (SEVERE SLOW-GO): 15° - 25°
// - Cliffs & Natural Rock Barriers (NO-GO): > 25° or vertical drop >= 12m
const isCliff = slopeDeg >= 25 || (slopeDeg >= 18 && localDrop >= 10) || localDrop >= 18;
// - Flat (GO): < 7° (< 12%)
// - Rolling (SLOW-GO): 7° - 15° (12% - 27%)
// - Rugged / Mountainous (SEVERE SLOW-GO): 15° - 28° (27% - 53%)
// - Natural Cliffs & Rock Escarpments (NO-GO): >= 28° (Physical vertical barrier)
const isCliff = slopeDeg >= 28;
if (isCliff) {
cliffCount++;
@@ -850,18 +850,17 @@ export async function calculateTerrainStudy(
lng: Number(cellCenterLng.toFixed(5)),
dropMeters: localDrop,
slopeDegrees: slopeDeg,
label: `🧗‍♂️ قاطع صخري وجرف حاد (سقوط ${localDrop}م - ميل ${slopeDeg}°)`,
label: `🧗‍♂️ جرف صخري حاد (${localDrop}م / ${slopeDeg}°)`,
tacticalImpact: 'مانع طبيعي قطعي - غير قابل لاجتياز الدروع والآليات، يفرض ممرات إجبارية'
});
// Add prominent cliff barrier polygon & line
// Add cliff barrier polygon without title label spam
spatialFeatures.push({
type: 'Feature',
properties: {
layerType: 'cliff',
category: 'natural-obstacle',
color: '#dc2626',
title: `🧗‍♂️ قاطع صخري وجرف حاد (${localDrop}م / ${slopeDeg}°)`,
color: '#ef4444',
slope: slopeDeg,
drop: localDrop,
elevation: cellElevAvg
@@ -879,7 +878,6 @@ export async function calculateTerrainStudy(
layerType: 'slope-sector',
category: 'severe-slow-go',
color: '#f97316',
title: `انحدار جبلي وعر (SEVERE SLOW-GO) [${slopeDeg}°]`,
slope: slopeDeg,
elevation: cellElevAvg
},
@@ -896,7 +894,6 @@ export async function calculateTerrainStudy(
layerType: 'slope-sector',
category: 'slow-go',
color: '#eab308',
title: `تضاريس متموجة (SLOW-GO) [${slopeDeg}°]`,
slope: slopeDeg,
elevation: cellElevAvg
},
@@ -913,7 +910,6 @@ export async function calculateTerrainStudy(
layerType: 'slope-sector',
category: 'go',
color: '#22c55e',
title: `ممر حركة منبسط (GO) [${slopeDeg}°]`,
slope: slopeDeg,
elevation: cellElevAvg
},
@@ -926,6 +922,37 @@ export async function calculateTerrainStudy(
}
}
// Add Key Terrain POI Points (Only these will display text badges on the map)
spatialFeatures.push({
type: 'Feature',
properties: {
category: 'peak',
layerType: 'poi',
title: `▲ أعلى قمة: ${highestPoint.elevation}م`,
elevation: highestPoint.elevation,
color: '#22c55e'
},
geometry: {
type: 'Point',
coordinates: [highestPoint.lng, highestPoint.lat]
}
});
spatialFeatures.push({
type: 'Feature',
properties: {
category: 'valley',
layerType: 'poi',
title: `▼ أخفض نقطة: ${lowestPoint.elevation}م`,
elevation: lowestPoint.elevation,
color: '#06b6d4'
},
geometry: {
type: 'Point',
coordinates: [lowestPoint.lng, lowestPoint.lat]
}
});
// 5. Statistics of Slope Distribution
const totalCells = Math.max(1, slopeValues.length);
const flatPct = Math.round((flatCount / totalCells) * 100);