diff --git a/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx b/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx index 9bdcff13c8781..f504ad8241bdf 100644 --- a/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx +++ b/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx @@ -15,7 +15,10 @@ import sandboxedEval from '../../../../modules/sandbox'; const DOUBLE_CLICK_TRESHOLD = 250; // milliseconds -function getPoints(features) { +function getPoints(features, lineType) { + if (lineType === 'zipcode' || lineType === 'fsa') { + return features.map(d => d.polygon).flat().flat(); + } return features.map(d => d.polygon).flat(); } @@ -132,7 +135,7 @@ class DeckGLPolygon extends React.Component { } = getPlaySliderParams(timestamps, granularity); const viewport = props.formData.autozoom - ? fitViewport(props.viewport, getPoints(features)) + ? fitViewport(props.viewport, getPoints(features, props.payload.form_data.line_type)) : props.viewport; return {