From 70f1f9ffacb9af5b693ac9dd2eaac42b5e6c1766 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sun, 19 Aug 2018 17:32:18 +0100 Subject: [PATCH] Added 'show-collision-boxes' query parameter --- src/components/App.jsx | 3 ++- src/components/map/MapboxGlMap.jsx | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index da0aef4..e317f92 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -176,7 +176,8 @@ export default class App extends React.Component { survey: localStorage.hasOwnProperty('survey') ? false : true }, mapOptions: { - showTileBoundaries: queryUtil.asBool(queryObj, "show-tile-boundaries") + showTileBoundaries: queryUtil.asBool(queryObj, "show-tile-boundaries"), + showCollisionBoxes: queryUtil.asBool(queryObj, "show-collision-boxes") }, mapFilter: queryObj["color-blindness-emulation"], } diff --git a/src/components/map/MapboxGlMap.jsx b/src/components/map/MapboxGlMap.jsx index 18f3e95..eb27609 100644 --- a/src/components/map/MapboxGlMap.jsx +++ b/src/components/map/MapboxGlMap.jsx @@ -104,6 +104,7 @@ export default class MapboxGlMap extends React.Component { } map.showTileBoundaries = this.props.options.showTileBoundaries; + map.showCollisionBoxes = this.props.options.showCollisionBoxes; } componentDidMount() { @@ -117,6 +118,7 @@ export default class MapboxGlMap extends React.Component { const map = new MapboxGl.Map(mapOpts); map.showTileBoundaries = mapOpts.showTileBoundaries; + map.showCollisionBoxes = mapOpts.showCollisionBoxes; const zoom = new ZoomControl; map.addControl(zoom, 'top-right');