mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-11-10 07:47:46 +01:00
Rename to FeatureLayerPopup
This commit is contained in:
parent
f806e797fa
commit
0f272e233b
2 changed files with 8 additions and 6 deletions
|
@ -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
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue