From c9e360d67503cfc8e8eb59fa2067da746bae63c1 Mon Sep 17 00:00:00 2001 From: orangemug Date: Mon, 6 Apr 2020 08:47:13 +0100 Subject: [PATCH] Fix layer selection via --- src/components/map/MapboxGlMap.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/map/MapboxGlMap.jsx b/src/components/map/MapboxGlMap.jsx index 3b04702..02ddc8d 100644 --- a/src/components/map/MapboxGlMap.jsx +++ b/src/components/map/MapboxGlMap.jsx @@ -170,7 +170,7 @@ export default class MapboxGlMap extends React.Component { if(this.props.inspectModeEnabled) { return renderPopup(, tmpNode); } else { - return renderPopup(, tmpNode); + return renderPopup(, tmpNode); } } }) @@ -208,6 +208,11 @@ export default class MapboxGlMap extends React.Component { map.on("zoomend", mapViewChange); } + onLayerSelectById = (id) => { + const index = this.props.mapStyle.layers.findIndex(layer => layer.id === id); + this.props.onLayerSelect(index); + } + render() { if(IS_SUPPORTED) { return