Possibly fix for heatmap
This commit is contained in:
parent
44da56f823
commit
13f06a0ce5
@ -74,17 +74,41 @@ export class MapService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public drawHeatmap(): void {
|
public drawHeatmap(): void {
|
||||||
|
// PLS LOOK AT THIS - START
|
||||||
const heatPoints = this.bikePoints.map(bikePoint => ({
|
const heatPoints = this.bikePoints.map(bikePoint => ({
|
||||||
lat: bikePoint.lat,
|
lat: bikePoint.lat,
|
||||||
lon: bikePoint.lon,
|
lon: bikePoint.lon,
|
||||||
intensity: this.getIntensity(bikePoint.status)
|
intensity: this.getIntensity(bikePoint.status)
|
||||||
}));
|
}));
|
||||||
const heatLayer = L.heatLayer(heatPoints, {
|
|
||||||
max: 1.0,
|
this.mapOverlays.Heatmap = L.heatLayer(heatPoints, {
|
||||||
minOpacity: 0.2,
|
max: 0.3,
|
||||||
radius: 100
|
radius: 90
|
||||||
});
|
});
|
||||||
this.mapOverlays.Heatmap = heatLayer;
|
|
||||||
|
const heatPointsBla = this.bikePoints.map(bikePoint => ([
|
||||||
|
bikePoint.lat,
|
||||||
|
bikePoint.lon,
|
||||||
|
this.getIntensity(bikePoint.status)
|
||||||
|
]));
|
||||||
|
|
||||||
|
this.mapOverlays.Heatmap2 = L.heatLayer(heatPointsBla, {
|
||||||
|
max: 0.3,
|
||||||
|
radius: 90
|
||||||
|
});
|
||||||
|
|
||||||
|
const heatPointsBla2 = this.bikePoints.map(bikePoint => ([
|
||||||
|
bikePoint.lat,
|
||||||
|
bikePoint.lon,
|
||||||
|
bikePoint.status.NbBikes
|
||||||
|
]));
|
||||||
|
|
||||||
|
this.mapOverlays.Heatmap3 = L.heatLayer(heatPointsBla2, {
|
||||||
|
max: 5,
|
||||||
|
radius: 90
|
||||||
|
});
|
||||||
|
// PLS LOOK AT THIS - END
|
||||||
|
|
||||||
L.control.layers(null, this.mapOverlays).addTo(this.map);
|
L.control.layers(null, this.mapOverlays).addTo(this.map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user