Skip to content

Commit

Permalink
fix rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
MFlores2021 committed Mar 3, 2021
1 parent fa28f7a commit 98769f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fieldmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default class Fieldmap {
clusterCenters.push(turf.getCoord(turf.center(cluster)));
});
let bearing = turf.bearing(center, this.northernmost(clusterCenters[0], clusterCenters[1]));
this.rotation = 90-(Math.round(bearing) == 0 ? 90:bearing);
this.rotation = 90-( (Math.round(Math.abs(bearing)) == 0 || Math.round(Math.abs(bearing)) == 90) ? 90:bearing);
this.geoJson = turf.transformRotate(this.geoJson, this.rotation);
}

Expand Down

0 comments on commit 98769f9

Please sign in to comment.