Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Avoid wrapping longitude values of exactly 180 and 360
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Oct 24, 2018
1 parent 7def088 commit fbac065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/mbgl/util/geo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LatLng {
// world, unwrap the start longitude to ensure the shortest path is taken.
void unwrapForShortestPath(const LatLng& end) {
const double delta = std::abs(end.lon - lon);
if (delta < util::LONGITUDE_MAX || delta > util::DEGREES_MAX) return;
if (delta <= util::LONGITUDE_MAX || delta >= util::DEGREES_MAX) return;
if (lon > 0 && end.lon < 0) lon -= util::DEGREES_MAX;
else if (lon < 0 && end.lon > 0) lon += util::DEGREES_MAX;
}
Expand Down

0 comments on commit fbac065

Please sign in to comment.