Improve inspect popups

This commit is contained in:
Lukas Martinelli
2016-12-25 17:46:18 +01:00
parent 720c8f108b
commit e1bc2a321a
8 changed files with 133 additions and 55 deletions

View File

@@ -4,9 +4,10 @@ import MapboxGl from 'mapbox-gl'
import validateColor from 'mapbox-gl-style-spec/lib/validate/validate_color'
import colors from '../../config/colors'
import style from '../../libs/style'
import FeatureLayerTable from './FeatureLayerTable'
import FeaturePropertyPopup from './FeaturePropertyPopup'
import { generateColoredLayers } from '../../libs/stylegen'
import 'mapbox-gl/dist/mapbox-gl.css'
import '../../mapboxgl.css'
function convertInspectStyle(mapStyle, sources) {
const newStyle = {
@@ -27,7 +28,7 @@ function convertInspectStyle(mapStyle, sources) {
function renderPopup(features) {
var mountNode = document.createElement('div');
ReactDOM.render(<FeatureLayerTable features={features} />, mountNode)
ReactDOM.render(<FeaturePropertyPopup features={features} />, mountNode)
return mountNode.innerHTML;
}