diff --git a/lib/transitive.js b/lib/transitive.js index 9182a149..8d978e14 100644 --- a/lib/transitive.js +++ b/lib/transitive.js @@ -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()