import React from 'react' import PropTypes from 'prop-types' import InputBlock from '../inputs/InputBlock' import StringInput from '../inputs/StringInput' function displayValue(value) { if (typeof value === 'undefined' || value === null) return value; if (value instanceof Date) return value.toLocaleString(); if (typeof value === 'object' || typeof value === 'number' || typeof value === 'string') return value.toString(); return value; } function renderProperties(feature) { return Object.keys(feature.properties).map(propertyName => { const property = feature.properties[propertyName] return }) } function renderFeature(feature) { return
{feature.layer['source-layer']}
{renderProperties(feature)}
} class FeaturePropertyPopup extends React.Component { static propTypes = { features: PropTypes.array } render() { const features = this.props.features return
{features.map(renderFeature)}
} } export default FeaturePropertyPopup