mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-25 06:53:00 +00:00
Re-enable the layer manager in the top-left
This commit is contained in:
parent
e09419b018
commit
78f4a5946a
3 changed files with 5 additions and 3 deletions
|
@ -51,6 +51,7 @@ class MapManager {
|
||||||
console.info("[map] Loading device markers....");
|
console.info("[map] Loading device markers....");
|
||||||
this.setup_device_markers()
|
this.setup_device_markers()
|
||||||
.then(() => console.info("[map] Device markers loaded successfully."))
|
.then(() => console.info("[map] Device markers loaded successfully."))
|
||||||
|
.then(this.setup_overlay.bind(this))
|
||||||
.then(this.setup_layer_control.bind(this));
|
.then(this.setup_layer_control.bind(this));
|
||||||
|
|
||||||
// Add the heatmap
|
// Add the heatmap
|
||||||
|
@ -63,7 +64,6 @@ class MapManager {
|
||||||
|
|
||||||
this.ui = new UI(Config, this);
|
this.ui = new UI(Config, this);
|
||||||
this.ui.setup().then(() => console.log("[map] Settings initialised."));
|
this.ui.setup().then(() => console.log("[map] Settings initialised."));
|
||||||
this.setup_overlay();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_overlay() {
|
setup_overlay() {
|
||||||
|
@ -126,7 +126,7 @@ class MapManager {
|
||||||
}, { // Overlay(s)
|
}, { // Overlay(s)
|
||||||
"Devices": this.device_markers.layer,
|
"Devices": this.device_markers.layer,
|
||||||
// TODO: Have 1 heatmap layer per reading type?
|
// TODO: Have 1 heatmap layer per reading type?
|
||||||
// "Heatmap": this.heatmap.layer
|
"Heatmap": this.overlay.layer
|
||||||
}, { // Options
|
}, { // Options
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,6 +6,8 @@ import VoronoiCell from './VoronoiCell.mjs';
|
||||||
import Vector2 from '../Helpers/Vector2.mjs';
|
import Vector2 from '../Helpers/Vector2.mjs';
|
||||||
|
|
||||||
class VoronoiManager {
|
class VoronoiManager {
|
||||||
|
get layer() { return this.overlay.layer; }
|
||||||
|
|
||||||
constructor(in_device_data, map) {
|
constructor(in_device_data, map) {
|
||||||
this.device_data = in_device_data;
|
this.device_data = in_device_data;
|
||||||
this.overlay = new VoronoiOverlay();
|
this.overlay = new VoronoiOverlay();
|
||||||
|
|
|
@ -99,7 +99,7 @@ class VoronoiOverlay {
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
// TODO: Replace this with an actual colour
|
// TODO: Replace this with an actual colour
|
||||||
"colour": `hsla(${(Math.random()*360).toFixed(2)}, 50%, 50%, 0.6)`
|
"colour": `hsl(${(Math.random()*360).toFixed(2)}, 50%, 50%)`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue