diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-23 22:47:40 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-26 17:15:51 +0200 |
commit | 52cce7925d32181a20a79978479c5552fa6ae810 (patch) | |
tree | 4b932205bcc6eab2b61cdec72068a2871d3dd132 /src/mbgl | |
parent | 82be3104cd40372e6f99284ff0fccd1e3879fd1d (diff) | |
download | qtlocation-mapboxgl-52cce7925d32181a20a79978479c5552fa6ae810.tar.gz |
[core] Camera center and anchor points are mutually exclusive
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/map/transform.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 0d633499cf..03a1e117f7 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -561,7 +561,9 @@ void Transform::startTransition(const CameraOptions& camera, observer.onCameraWillChange(isAnimated ? MapObserver::CameraChangeMode::Animated : MapObserver::CameraChangeMode::Immediate); // Associate the anchor, if given, with a coordinate. - optional<ScreenCoordinate> anchor = camera.anchor; + // Anchor and center points are mutually exclusive, with preference for the + // center point when both are set. + optional<ScreenCoordinate> anchor = camera.center ? nullopt : camera.anchor; LatLng anchorLatLng; if (anchor) { anchor->y = state.size.height - anchor->y; |