diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-23 15:26:10 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-27 21:38:36 +0200 |
commit | e8f7866e9e3328bb4d40da172fb5a549315fd486 (patch) | |
tree | 88d4ca1f9ecfab5d54cfa3a3e340fb8c04b99141 /src/mbgl | |
parent | 9d1d4ecdb8bcbb10c8b1f3125ca2d78510856ce9 (diff) | |
download | qtlocation-mapboxgl-e8f7866e9e3328bb4d40da172fb5a549315fd486.tar.gz |
[core] Remove error-prone setlatLng overload
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/map/map.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/map/transform.cpp | 11 | ||||
-rw-r--r-- | src/mbgl/map/transform.hpp | 1 |
3 files changed, 3 insertions, 17 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 1f64cf3acc..983d43eed3 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -304,7 +304,7 @@ void Map::moveBy(const ScreenCoordinate& point, const AnimationOptions& animatio void Map::setLatLng(const LatLng& latLng, const AnimationOptions& animation) { impl->cameraMutated = true; - setLatLng(latLng, optional<ScreenCoordinate> {}, animation); + setLatLng(latLng, animation); } void Map::setLatLng(const LatLng& latLng, const EdgeInsets& padding, const AnimationOptions& animation) { @@ -313,12 +313,6 @@ void Map::setLatLng(const LatLng& latLng, const EdgeInsets& padding, const Anima impl->onUpdate(); } -void Map::setLatLng(const LatLng& latLng, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) { - impl->cameraMutated = true; - impl->transform.setLatLng(latLng, anchor, animation); - impl->onUpdate(); -} - LatLng Map::getLatLng(const EdgeInsets& padding) const { return impl->transform.getLatLng(padding); } diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 03a1e117f7..452cb19a09 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -323,22 +323,15 @@ void Transform::moveBy(const ScreenCoordinate& offset, const AnimationOptions& a } void Transform::setLatLng(const LatLng& latLng, const AnimationOptions& animation) { - setLatLng(latLng, optional<ScreenCoordinate> {}, animation); -} - -void Transform::setLatLng(const LatLng& latLng, const EdgeInsets& padding, const AnimationOptions& animation) { CameraOptions camera; camera.center = latLng; - camera.padding = padding; easeTo(camera, animation); } -void Transform::setLatLng(const LatLng& latLng, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) { +void Transform::setLatLng(const LatLng& latLng, const EdgeInsets& padding, const AnimationOptions& animation) { CameraOptions camera; camera.center = latLng; - if (anchor) { - camera.padding = EdgeInsets(anchor->y, anchor->x, state.size.height - anchor->y, state.size.width - anchor->x); - } + camera.padding = padding; easeTo(camera, animation); } diff --git a/src/mbgl/map/transform.hpp b/src/mbgl/map/transform.hpp index bff44a2dcd..96573b1519 100644 --- a/src/mbgl/map/transform.hpp +++ b/src/mbgl/map/transform.hpp @@ -48,7 +48,6 @@ public: void moveBy(const ScreenCoordinate& offset, const AnimationOptions& = {}); void setLatLng(const LatLng&, const AnimationOptions& = {}); void setLatLng(const LatLng&, const EdgeInsets&, const AnimationOptions& = {}); - void setLatLng(const LatLng&, optional<ScreenCoordinate>, const AnimationOptions& = {}); void setLatLngZoom(const LatLng&, double zoom, const AnimationOptions& = {}); void setLatLngZoom(const LatLng&, double zoom, const EdgeInsets&, const AnimationOptions& = {}); LatLng getLatLng(const EdgeInsets& = {}) const; |