Skip to content

Commit

Permalink
Fix zipcode autozoom
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and betodealmeida committed Jan 3, 2019
1 parent 32a57bf commit 03860f8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 03860f8

Please sign in to comment.