Re-enable the layer manager in the top-left

This commit is contained in:
Starbeamrainbowlabs 2019-06-11 12:22:01 +01:00
parent e09419b018
commit 78f4a5946a
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 5 additions and 3 deletions

View file

@ -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
}); });

View file

@ -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();

View file

@ -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%)`
} }
}); });
} }