Skip to content
Snippets Groups Projects
Commit c1a55bfa authored by Janne Alatalo's avatar Janne Alatalo :neutral_face:
Browse files

Add all metadata to LamStation objects

parent b4f509bc
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ export function get_lam_points(api_url, set_state) { ...@@ -10,7 +10,7 @@ export function get_lam_points(api_url, set_state) {
for (let s of json.features) { for (let s of json.features) {
let id = s.id; let id = s.id;
let coordinates = s.geometry.coordinates; let coordinates = s.geometry.coordinates;
let station = new LamStation(id, coordinates, 0, 0); let station = new LamStation(id, coordinates, 0, 0, s);
stations = stations.set(id, station); stations = stations.set(id, station);
} }
set_state((prevState) => { set_state((prevState) => {
......
...@@ -2,7 +2,7 @@ import Rainbow from 'rainbowvis.js'; ...@@ -2,7 +2,7 @@ import Rainbow from 'rainbowvis.js';
class LamStation { class LamStation {
constructor(id, coordinates, avg_speed_dir1, avg_speed_dir2) { constructor(id, coordinates, avg_speed_dir1, avg_speed_dir2, data) {
this.id = id; this.id = id;
this.coordinates = coordinates; this.coordinates = coordinates;
this.avg_speed_dir1 = avg_speed_dir1; this.avg_speed_dir1 = avg_speed_dir1;
...@@ -14,6 +14,7 @@ class LamStation { ...@@ -14,6 +14,7 @@ class LamStation {
this.rainbow = new Rainbow(); this.rainbow = new Rainbow();
this.rainbow.setSpectrum("orange", "yellow", "green"); this.rainbow.setSpectrum("orange", "yellow", "green");
this.rainbow.setNumberRange(0.0, 1.0); this.rainbow.setNumberRange(0.0, 1.0);
this.data = data
} }
set_free_flow_speed_dir1(free_flow_speed) { set_free_flow_speed_dir1(free_flow_speed) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment