Skip to content

Commit

Permalink
Merge pull request #50 from conveyal/proper-scale-reset
Browse files Browse the repository at this point in the history
Properly update display internals when updating bounds
  • Loading branch information
landonreed committed May 22, 2020
2 parents f78e3f2 + 7f87047 commit 06c5750
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/transitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export default class Transitive {
if (!this.display) return
const smWestSouth = sm.forward(llBounds[0])
const smEastNorth = sm.forward(llBounds[1])
// reset the display to make sure the correct display scale is recomputed
// see https://github.com/conveyal/transitive.js/pull/50
this.display.reset()
this.display.setXDomain([smWestSouth[0], smEastNorth[0]])
this.display.setYDomain([smWestSouth[1], smEastNorth[1]])
this.display.computeScale()
Expand Down

0 comments on commit 06c5750

Please sign in to comment.