import React from 'react' import PropTypes from 'prop-types' import InputBlock from '../inputs/InputBlock' import StringInput from '../inputs/StringInput' import LayerIcon from '../icons/LayerIcon' function groupFeaturesBySourceLayer(features) { const sources = {} features.forEach(feature => { sources[feature.layer['source-layer']] = sources[feature.layer['source-layer']] || [] sources[feature.layer['source-layer']].push(feature) }) return sources } class FeatureLayerPopup extends React.Component { static propTypes = { features: PropTypes.array } render() { const sources = groupFeaturesBySourceLayer(this.props.features) const items = Object.keys(sources).map(vectorLayerId => { const layers = sources[vectorLayerId].map((feature, idx) => { return }) return