diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-27 19:58:35 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-04 14:45:32 +0200 |
commit | 21a39306da56c5d2c88447ba5ea053a7f989480a (patch) | |
tree | 7b932a7bb81c2de64546ef52bd72feb5aa4317c7 /platform/macos/src/MGLMapView.mm | |
parent | f5f10ec11989ccb403c2cd4261db74c44b263558 (diff) | |
download | qtlocation-mapboxgl-21a39306da56c5d2c88447ba5ea053a7f989480a.tar.gz |
[core] Remove map pitch setters/getters
Diffstat (limited to 'platform/macos/src/MGLMapView.mm')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 03088ac5c6..21aa2c3bef 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1357,10 +1357,11 @@ public: } - (MGLMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions { + mbgl::CameraOptions mapCamera = _mbglMap->getCameraOptions(); CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : _mbglMap->getLatLng()); double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel; CLLocationDirection direction = cameraOptions.angle ? mbgl::util::wrap(*cameraOptions.angle, 0., 360.) : self.direction; - CGFloat pitch = cameraOptions.pitch ? *cameraOptions.pitch : _mbglMap->getPitch(); + CGFloat pitch = cameraOptions.pitch ? *cameraOptions.pitch : *mapCamera.pitch; CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoomLevel, pitch, centerCoordinate.latitude, self.frame.size); @@ -1477,7 +1478,7 @@ public: if (gestureRecognizer.state == NSGestureRecognizerStateBegan) { _directionAtBeginningOfGesture = self.direction; - _pitchAtBeginningOfGesture = _mbglMap->getPitch(); + _pitchAtBeginningOfGesture = *_mbglMap->getCameraOptions().pitch; } else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) { MGLMapCamera *oldCamera = self.camera; BOOL didChangeCamera = NO; @@ -1490,7 +1491,7 @@ public: [self didChangeValueForKey:@"direction"]; } if (self.pitchEnabled) { - _mbglMap->setPitch(_pitchAtBeginningOfGesture + delta.y / 5, center); + _mbglMap->jumpTo(mbgl::CameraOptions().withPitch(_pitchAtBeginningOfGesture + delta.y / 5).withAnchor(center)); didChangeCamera = YES; } |