summaryrefslogtreecommitdiff
path: root/src/mbgl/map/transform.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-13 19:04:59 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-13 21:38:20 +0200
commitfe7e208b4224101f3feeddf9808ecedd3b0f486f (patch)
treed5ef3133217c9cb96c2a917be3e9b3d3e1ba9e38 /src/mbgl/map/transform.cpp
parent8e30a4a0806e970e727c3563b8ed57dbaf9a0fa0 (diff)
downloadqtlocation-mapboxgl-fe7e208b4224101f3feeddf9808ecedd3b0f486f.tar.gz
[core] Implement LatLng::null()
Diffstat (limited to 'src/mbgl/map/transform.cpp')
-rw-r--r--src/mbgl/map/transform.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index 9868d96485..26245c86ee 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -651,7 +651,7 @@ void Transform::setGestureInProgress(bool inProgress) {
#pragma mark Conversion and projection
ScreenCoordinate Transform::latLngToScreenCoordinate(const LatLng& latLng) const {
- if (!latLng) return {};
+ if (!latLng) return ScreenCoordinate::null();
// If the center and point coordinates are not in the same side of the
// antimeridian, we need to unwrap the point longitude to make sure it can
@@ -672,7 +672,8 @@ ScreenCoordinate Transform::latLngToScreenCoordinate(const LatLng& latLng) const
}
LatLng Transform::screenCoordinateToLatLng(const ScreenCoordinate& point) const {
- if (!point) return {};
+ if (!point) return LatLng::null();
+
ScreenCoordinate flippedPoint = point;
flippedPoint.y = state.height - flippedPoint.y;
return state.screenCoordinateToLatLng(flippedPoint);