Skip to content

Commit

Permalink
Only calculate max distance if clipstart and clipend are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
karimnaaji committed May 21, 2020
1 parent f2f7373 commit 432f227
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/data/bucket/line_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,9 @@ class LineBucket implements Bucket {
this.totalDistance += vertices[i].dist(vertices[i + 1]);
}
this.updateScaledDistance();
this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance / (this.clipEnd - this.clipStart));
}

this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance / (this.clipEnd - this.clipStart));

const isPolygon = vectorTileFeatureTypes[feature.type] === 'Polygon';

// If the line has duplicate vertices at the ends, adjust start/length to remove them.
Expand Down

0 comments on commit 432f227

Please sign in to comment.