Skip to content

Commit

Permalink
fix a bug when zooming in/out too much
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jul 17, 2018
1 parent 1531e47 commit a7941ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ function updateOrientations() {
ctx.stroke();

var features = map.queryRenderedFeatures({layers: ['road']});
if (features.length === 0) return;
if (features.length === 0) {
ctx.restore();
return;
}

var ruler = cheapRuler(map.getCenter().lat);
var bounds = map.getBounds();
Expand Down

0 comments on commit a7941ce

Please sign in to comment.