diff --git a/package.json b/package.json index e478c77..91700db 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lodash.isequal": "^4.5.0", "lodash.throttle": "^4.1.1", "mapbox-gl": "^0.43.0", - "mapbox-gl-inspect": "^1.2.4", + "mapbox-gl-inspect": "^1.2.5", "maputnik-design": "github:maputnik/design", "mousetrap": "^1.6.1", "ol-mapbox-style": "^1.0.1", diff --git a/src/components/App.jsx b/src/components/App.jsx index d51f724..d90415a 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -249,7 +249,8 @@ export default class App extends React.Component { } else { return + highlightedLayer={this.state.mapStyle.layers[this.state.selectedLayerIndex]} + onLayerSelect={this.onLayerSelect.bind(this)} /> } } diff --git a/src/components/layers/LayerList.jsx b/src/components/layers/LayerList.jsx index c30c647..a27807e 100644 --- a/src/components/layers/LayerList.jsx +++ b/src/components/layers/LayerList.jsx @@ -164,7 +164,7 @@ class LayerListContainer extends React.Component { const grp = listItems.push(grp) @@ -172,9 +172,10 @@ class LayerListContainer extends React.Component { layers.forEach((layer, idxInGroup) => { const groupIdx = findClosestCommonPrefix(this.props.layers, idx) + const listItem = 1 && this.isCollapsed(groupPrefix, groupIdx), + 'maputnik-layer-list-item-collapsed': layers.length > 1 && this.isCollapsed(groupPrefix, groupIdx) && idx !== this.props.selectedLayerIndex, 'maputnik-layer-list-item-group-last': idxInGroup == layers.length - 1 && layers.length > 1 })} index={idx} diff --git a/src/components/map/FeatureLayerPopup.jsx b/src/components/map/FeatureLayerPopup.jsx index c9196a7..5d14d01 100644 --- a/src/components/map/FeatureLayerPopup.jsx +++ b/src/components/map/FeatureLayerPopup.jsx @@ -29,6 +29,7 @@ function groupFeaturesBySourceLayer(features) { class FeatureLayerPopup extends React.Component { static propTypes = { + onLayerSelect: PropTypes.func.isRequired, features: PropTypes.array } @@ -40,6 +41,9 @@ class FeatureLayerPopup extends React.Component { return