diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-07 18:07:23 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-10 03:36:45 +0200 |
commit | 026b6d4c01a3d96af9629cc1790373137ecab950 (patch) | |
tree | c63cdb8429c793c3abfa8bc92c68c8fb848d7c54 /src/mbgl/map/transform_state.hpp | |
parent | 808bf7004a4360a4cc7095f97c235c92d3679f8b (diff) | |
download | qtlocation-mapboxgl-026b6d4c01a3d96af9629cc1790373137ecab950.tar.gz |
[core] Coordinate wrapping fixes
- Make returning LatLngs unwrapped by default.
- PointAnnotation and ShapeAnnotation are always wrapped so they can be
selected via intersection from the visible tile boundaries.
- Fixes LatLng::wrap() calculation.
- Fixes LatLng::unwrapForShortestPath() calculation.
The new unwrapForShortestPath algorithm unwraps the start coordinate
either forwards or backwards depending on the end coordinate value, so
we can always cross the antimeridian when needed and still obtain a
wrapped end coordinate in the end.
Fixes #4214.
Diffstat (limited to 'src/mbgl/map/transform_state.hpp')
-rw-r--r-- | src/mbgl/map/transform_state.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/map/transform_state.hpp b/src/mbgl/map/transform_state.hpp index 797a28692e..ef3a5dfefd 100644 --- a/src/mbgl/map/transform_state.hpp +++ b/src/mbgl/map/transform_state.hpp @@ -37,7 +37,7 @@ public: ConstrainMode getConstrainMode() const; // Position - LatLng getLatLng(LatLng::WrapMode = LatLng::Wrapped) const; + LatLng getLatLng(LatLng::WrapMode = LatLng::Unwrapped) const; double pixel_x() const; double pixel_y() const; @@ -65,7 +65,7 @@ public: // Conversion and projection ScreenCoordinate latLngToScreenCoordinate(const LatLng&) const; - LatLng screenCoordinateToLatLng(const ScreenCoordinate&, LatLng::WrapMode = LatLng::Wrapped) const; + LatLng screenCoordinateToLatLng(const ScreenCoordinate&, LatLng::WrapMode = LatLng::Unwrapped) const; double xLng(double x, double worldSize) const; double yLat(double y, double worldSize) const; |