[geo] Add Deckgl GeoJson layer#4068
[geo] Add Deckgl GeoJson layer#4068hughhhh wants to merge 16 commits intoapache:masterfrom hughhhh:deckgl-geojson-layer
Conversation
mistercrunch
left a comment
There was a problem hiding this comment.
We'll have to do a bit of thinking as to how we allow people to define/override the properties of the GeoJSON
|
|
||
| geojson: { | ||
| type: 'SelectControl', | ||
| label: t('GeoJSON'), |
| ], | ||
| }, | ||
| { | ||
| label: t('Grid'), |
There was a problem hiding this comment.
This section/controls are not relevant for the GeoJSON viz
| ], | ||
| }, | ||
| ], | ||
| controlOverrides: { |
There was a problem hiding this comment.
This override is not relevant here
| const data = payload.data.geojson.features.map(d => ({ | ||
| ...d, | ||
| properties: { | ||
| fillColor: [c.r, c.g, c.b, 255 * c.a], |
There was a problem hiding this comment.
The GeoJSON may have its own colors defined, if that's the case the user may or may not want to override it. I feel like we'll need an intricate "GeoJSON properties" control where the user could decide to override or not properties like fillColor, strokeColor, strokeWidth, ...
https://github.com/uber/deck.gl/blob/master/docs/layers/geojson-layer.md
| [VIZ_TYPES.deck_screengrid]: require('./deckgl/screengrid.jsx'), | ||
| [VIZ_TYPES.deck_grid]: require('./deckgl/grid.jsx'), | ||
| [VIZ_TYPES.deck_hex]: require('./deckgl/hex.jsx'), | ||
| area: require('./nvd3_vis.js'), |
There was a problem hiding this comment.
Let's use VIZ_TYPES here, I think you picked the wrong side of the merge conflict.
| const data = payload.data.geojson.features.map(d => ({ | ||
| ...d, | ||
| properties: { | ||
| fillColor: [c.r, c.g, c.b, 255 * c.a], |
There was a problem hiding this comment.
I still feel like there should be a way to not override the color defined in the GeoJSON (if any). We need better mapping and precedence rules here.
First, a mapping from the spec to deck.gl's supported props.
Then, clearable colorpickers (we could use opacity=0 as a hint to not override, opacity=0 could be the default), only if opacity!=0 do we override the GeoJSON provided colors.
As a last resort, we should have a color if opacity=0 and color isn't defined in the geojson.
All of this should be made clear in the controls tooltip.
This is hard to model, let's chat about it.
|
Moving -> #4097 |
Added DeckGLs GeoJson layer as a new visualization type
@mistercrunch