mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-15 04:21:17 +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
|
return sources
|
||||||
}
|
}
|
||||||
|
|
||||||
class FeatureLayerTable extends React.Component {
|
class FeatureLayerPopup extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const sources = groupFeaturesBySourceLayer(this.props.features)
|
const sources = groupFeaturesBySourceLayer(this.props.features)
|
||||||
|
|
||||||
const items = Object.keys(sources).map(vectorLayerId => {
|
const items = Object.keys(sources).map(vectorLayerId => {
|
||||||
const layers = sources[vectorLayerId].map(feature => {
|
const layers = sources[vectorLayerId].map((feature, idx) => {
|
||||||
return <label style={{
|
return <label
|
||||||
|
key={idx}
|
||||||
|
style={{
|
||||||
...input.label,
|
...input.label,
|
||||||
display: 'block',
|
display: 'block',
|
||||||
width: 'auto',
|
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 ReactDOM from 'react-dom'
|
||||||
import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js'
|
import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js'
|
||||||
import MapboxInspect from 'mapbox-gl-inspect'
|
import MapboxInspect from 'mapbox-gl-inspect'
|
||||||
import FeatureLayerTable from './FeatureLayerTable'
|
import FeatureLayerPopup from './FeatureLayerPopup'
|
||||||
import FeaturePropertyPopup from './FeaturePropertyPopup'
|
import FeaturePropertyPopup from './FeaturePropertyPopup'
|
||||||
import validateColor from 'mapbox-gl-style-spec/lib/validate/validate_color'
|
import validateColor from 'mapbox-gl-style-spec/lib/validate/validate_color'
|
||||||
import colors from '../../config/colors'
|
import colors from '../../config/colors'
|
||||||
|
@ -13,7 +13,7 @@ import '../../mapboxgl.css'
|
||||||
|
|
||||||
function renderLayerPopup(features) {
|
function renderLayerPopup(features) {
|
||||||
var mountNode = document.createElement('div');
|
var mountNode = document.createElement('div');
|
||||||
ReactDOM.render(<FeatureLayerTable features={features} />, mountNode)
|
ReactDOM.render(<FeatureLayerPopup features={features} />, mountNode)
|
||||||
return mountNode.innerHTML;
|
return mountNode.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue