Skip to content

Commit

Permalink
Fix zipcode autozoom
Browse files Browse the repository at this point in the history
(cherry picked from commit 03860f8)
(cherry picked from commit a2b2852)
(cherry picked from commit 27e2709)
  • Loading branch information
mistercrunch authored and xtinec committed Feb 5, 2019
1 parent 112a2b7 commit e9469ed
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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();
}

Expand Down Expand Up @@ -151,7 +154,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 {
Expand Down

0 comments on commit e9469ed

Please sign in to comment.