diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-01-22 16:19:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 16:19:08 -0800 |
commit | 0226a0f81aa492dc22f6b3bff0a888400adddd34 (patch) | |
tree | 61d670f2fd41f8c51015b8963f3081e62c166ffe /platform | |
parent | ca129e0c79c60db57c7ad3144aad3f4293dab8cd (diff) | |
download | qtlocation-mapboxgl-0226a0f81aa492dc22f6b3bff0a888400adddd34.tar.gz |
[ios] Fix wrong coordinates bounds when setting direction. (#13761)
Fixes an issue calculating the view port when setting visible coordinates with a direction.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 9212b97c9a..201c347daf 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -11,6 +11,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added the `-[MGLShapeSource leavesOfCluster:offset:limit:]`, `-[MGLShapeSource childrenOfCluster:]`, `-[MGLShapeSource zoomLevelForExpandingCluster:]` methods for inspecting a cluster in an `MGLShapeSource`s created with the `MGLShapeSourceOptionClustered` option. Feature querying now returns clusters represented by `MGLPointFeatureCluster` objects (that conform to the `MGLCluster` protocol). ([#12952](https://github.com/mapbox/mapbox-gl-native/pull/12952) * `MGLMapView` no longer freezes on external displays connected through AirPlay or CarPlay when the main device’s screen goes to sleep or the user manually locks the screen. ([#13701](https://github.com/mapbox/mapbox-gl-native/pull/13701)) * Fixed a bug where selecting partially on-screen annotations (without a callout) would move the map. ([#13727](https://github.com/mapbox/mapbox-gl-native/pull/13727)) +* Fixed an issue calculating the viewport when setting visible coordinates with a `direction`. ([#13761](https://github.com/mapbox/mapbox-gl-native/pull/13761)) ## 4.7.1 - December 21, 2018 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index b3b8c8777d..e473bc1c0e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3329,12 +3329,10 @@ public: { latLngs.push_back({coordinates[i].latitude, coordinates[i].longitude}); } + + CLLocationDirection cameraDirection = direction >= 0 ? direction : 0; - mbgl::CameraOptions cameraOptions = self.mbglMap.cameraForLatLngs(latLngs, padding); - if (direction >= 0) - { - cameraOptions.angle = direction; - } + mbgl::CameraOptions cameraOptions = self.mbglMap.cameraForLatLngs(latLngs, padding, cameraDirection); mbgl::AnimationOptions animationOptions; if (duration > 0) |