-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
🎥 😛 👍 |
One small change here is that, where currently possible, I’ve changed some animation timing curves from linear to the system default, which eases in a little. So that’ll make the user dot move a little less jarringly, at least until we manage to make it move continuously (and animate linearly) for #1582. |
void Map::setPitch(double pitch) { | ||
transform->setPitch(std::min(pitch, 60.0) * M_PI / 180); | ||
void Map::setPitch(double pitch, const Duration& duration) { | ||
transform->setPitch(util::clamp(pitch, 0., 90.) * M_PI / 180, duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 60 here was intentional. We don't support level of detail loading so if the pitch is set it to 90 it will try to load all the tiles in the world
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, this is an artifact from rebasing.
822cc57
to
02cc15f
Compare
Cursory glance looks good. Let me pull it down & double-check. |
No red flags to me, but we'll roll a build and make sure things feel good. I think at this point we are 👍. |
@@ -0,0 +1,36 @@ | |||
#import "Mapbox.h" | |||
|
|||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious @1ec5 why this is required, for an iOS header which should be brought in with the once-safe #import
vs. #include
anyway.
Plumbed camera options all the way through to MGLMapView. Added a method that lets you specify a direction in addition to center point and zoom level. Added Map::jumpTo() for parity with mapbox-gl-js. Replaced usage of Map::setLatLng() and Map::setLatLngZoom() with Map::jumpTo() or Map::easeTo() within MGLMapView. Replaced MGLMapView.pitch with MGLMapCamera for setting all supported degrees of freedom simultaneously. Simultaneously move and rotate with course. Support customizable timing functions on iOS. iosapp now persists an archived MGLMapCamera instead of separate viewpoint properties and also synchronizes user defaults on termination. This change implements persistence entirely in Objective-C, eliminating the use of the Objective-C++ implementation. Fixes #1643, fixes #1834. Ref #1581.
c11a45d
to
7b93107
Compare
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Previously in mapbox#2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. mapbox#2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke mapbox#2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Previously in mapbox#2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. mapbox#2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke mapbox#2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
The pre-existing methods on
mbgl::Map
only allow you to modify 2–3 degrees of freedom at once. This PR adds the concept of the viewer’s “camera”, allowing you to transition center coordinate, zoom level, rotation, and pitch all in one animation, and to configure that animation. The camera is represented by aCameraOptions
struct and manipulated byjumpTo()
andeaseTo()
methods, much like in Mapbox GL JS. On iOS, the camera is represented by an MGLMapCamera object that imitates MKMapCamera.jumpTo()
easeTo()
(fixes iOS setDirection:animated: cancels setCenterCoordinate:animated: #1643, Implement camera API #1834)flyTo()
(will fix flyTo equivalent #256)mbgl::Map
MGLMapView.pitch
(This PR was originally opened by @bleege as #2159, but we’ll need to merge into master instead of the perspective branch now that #2116 has landed.)
/cc @incanus @friedbunny @ansis @bleege