Rename to FeatureLayerPopup

This commit is contained in:
Lukas Martinelli 2017-01-09 23:04:08 +01:00
parent f806e797fa
commit 0f272e233b
2 changed files with 8 additions and 6 deletions

View file

@ -31,13 +31,15 @@ function groupFeaturesBySourceLayer(features) {
return sources
}
class FeatureLayerTable extends React.Component {
class FeatureLayerPopup extends React.Component {
render() {
const sources = groupFeaturesBySourceLayer(this.props.features)
const items = Object.keys(sources).map(vectorLayerId => {
const layers = sources[vectorLayerId].map(feature => {
return <label style={{
const layers = sources[vectorLayerId].map((feature, idx) => {
return <label
key={idx}
style={{
...input.label,
display: 'block',
width: 'auto',
@ -63,4 +65,4 @@ class FeatureLayerTable extends React.Component {
}
export default FeatureLayerTable
export default FeatureLayerPopup

View file

@ -2,7 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js'
import MapboxInspect from 'mapbox-gl-inspect'
import FeatureLayerTable from './FeatureLayerTable'
import FeatureLayerPopup from './FeatureLayerPopup'
import FeaturePropertyPopup from './FeaturePropertyPopup'
import validateColor from 'mapbox-gl-style-spec/lib/validate/validate_color'
import colors from '../../config/colors'
@ -13,7 +13,7 @@ import '../../mapboxgl.css'
function renderLayerPopup(features) {
var mountNode = document.createElement('div');
ReactDOM.render(<FeatureLayerTable features={features} />, mountNode)
ReactDOM.render(<FeatureLayerPopup features={features} />, mountNode)
return mountNode.innerHTML;
}