diff --git a/package.json b/package.json index c358b4b7..0bc256d3 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lodash.isequal": "^4.5.0", "lodash.throttle": "^4.1.1", "mapbox-gl": "^0.41.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 d51f7248..d90415aa 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 c30c647d..a27807ed 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 ca67de56..2b905aa1 100644 --- a/src/components/map/FeatureLayerPopup.jsx +++ b/src/components/map/FeatureLayerPopup.jsx @@ -16,6 +16,7 @@ function groupFeaturesBySourceLayer(features) { class FeatureLayerPopup extends React.Component { static propTypes = { + onLayerSelect: PropTypes.func.isRequired, features: PropTypes.array } @@ -27,6 +28,9 @@ class FeatureLayerPopup extends React.Component { return