@mytec: iter5 ready for test
This commit is contained in:
@@ -30,26 +30,24 @@ function rsrpToIntensity(rsrp: number): number {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate adaptive heatmap params based on zoom level.
|
||||
* Calculate adaptive heatmap visual params based on zoom level.
|
||||
*
|
||||
* radius/blur: smaller at close zoom to avoid blocky squares
|
||||
* maxIntensity: lower at close zoom so densely packed points
|
||||
* don't all saturate to a single solid color
|
||||
* Only radius and blur change with zoom (visual quality).
|
||||
* maxIntensity is CONSTANT at 1.0 so the same RSRP always
|
||||
* maps to the same color regardless of zoom level.
|
||||
*
|
||||
* Zoom 6 (country): radius=35, blur=18, max=0.90
|
||||
* Zoom 10 (region): radius=25, blur=13, max=0.70
|
||||
* Zoom 14 (city): radius=15, blur=9, max=0.50
|
||||
* Zoom 18 (street): radius=8, blur=6, max=0.30
|
||||
* Zoom 6 (country): radius=35, blur=18
|
||||
* Zoom 10 (region): radius=25, blur=13
|
||||
* Zoom 14 (city): radius=15, blur=9
|
||||
* Zoom 18 (street): radius=8, blur=6
|
||||
*/
|
||||
function getHeatmapParams(zoom: number) {
|
||||
const radius = Math.max(8, Math.min(40, 50 - zoom * 2.5));
|
||||
const blur = Math.max(6, Math.min(20, 30 - zoom * 1.5));
|
||||
// Dynamic max: prevents saturation at close zoom
|
||||
const maxIntensity = Math.max(0.3, Math.min(1.0, 1.2 - zoom * 0.05));
|
||||
return {
|
||||
radius: Math.round(radius),
|
||||
blur: Math.round(blur),
|
||||
maxIntensity,
|
||||
maxIntensity: 1.0, // CONSTANT — zoom-independent colors
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user