Skip to content

Commit

Permalink
Handle boundaries for Alaska
Browse files Browse the repository at this point in the history
  • Loading branch information
ericboucher committed May 14, 2018
1 parent 01dfc94 commit e31e9a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/utils/geojson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ export function boundingBox(points: RepresentativePoint[]) {
}
})))

/**
* FIXME - Less hacky handling of -180 and 0 degree spanning boundaries.
* Handle weird zoom behavior for Alaska and boundaries crossing the antemeridian.
*/
if (xmin < -150 && xmax > 0) {
xmax = -140
}

return {
sw: { lat: ymin, lng: xmin },
ne: { lat: ymax, lng: xmax }
Expand Down

0 comments on commit e31e9a5

Please sign in to comment.