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

Add bar height scaling when zooming in map

parent 1ca28225
No related branches found
No related tags found
No related merge requests found
Pipeline #9408 passed
...@@ -317,7 +317,12 @@ class PointMap extends Component { ...@@ -317,7 +317,12 @@ class PointMap extends Component {
}, },
filled: true, filled: true,
extruded: true, extruded: true,
getElevation: d => d.get_avg_traffic_vol() * 20, getElevation: d => {
let zoom = this.state.viewport.zoom;
// super hacky way of scaling the bar height
let vol_scale = 20 * (1.5 ** 6);
return d.get_avg_traffic_vol() * vol_scale / (1.5 ** zoom);
},
getLineColor: d => { getLineColor: d => {
if (this.state.mouseover === d.get_id()) { if (this.state.mouseover === d.get_id()) {
return [255, 0, 0]; return [255, 0, 0];
......
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