diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-01-25 14:17:59 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-01-26 17:19:22 -0800 |
commit | 7057a1bb4aa6777b277214c91f273c014934d1e4 (patch) | |
tree | e57500f22997933e3bb8e181a9804c888b68fe15 /include | |
parent | c5017652b97d0e519289b972a6b39762540a61a3 (diff) | |
download | qtlocation-mapboxgl-7057a1bb4aa6777b277214c91f273c014934d1e4.tar.gz |
[ios] Bifocal viewport in course tracking mode
When a targetCoordinate is specified in course tracking mode, the map automatically resizes the viewport to show both the user puck and the target, one at the top and the other at the bottom. The user puck now rotates its arrow in the course direction, no longer assuming that the viewport is facing the same way as the course.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index c0f4cd1365..b27db4976a 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -272,6 +272,46 @@ IB_DESIGNABLE */ @property (nonatomic, assign) BOOL displayHeadingCalibration; +/** + The geographic coordinate that is the subject of observation as the user + location is being tracked. + + By default, this property is set to an invalid coordinate, indicating that + there is no target. In course tracking mode, the target forms one of two foci + in the viewport, the other being the user location annotation. Typically, this + property is set to a destination or waypoint in a real-time navigation scene. + As the user annotation moves toward the target, the map automatically zooms in + to fit both foci optimally within the viewport. + + This property has no effect if the `userTrackingMode` property is set to a + value other than `MGLUserTrackingModeFollowWithCourse`. + + Changing the value of this property updates the map view with an animated + transition. If you don’t want to animate the change, use the + `-setTargetCoordinate:animated:` method instead. + */ +@property (nonatomic, assign) CLLocationCoordinate2D targetCoordinate; + +/** + Sets the geographic coordinate that is the subject of observation as the user + location is being tracked, with an optional transition animation. + + By default, the target coordinate is set to an invalid coordinate, indicating + that there is no target. In course tracking mode, the target forms one of two + foci in the viewport, the other being the user location annotation. Typically, + the target is set to a destination or waypoint in a real-time navigation scene. + As the user annotation moves toward the target, the map automatically zooms in + to fit both foci optimally within the viewport. + + This method has no effect if the `userTrackingMode` property is set to a value + other than `MGLUserTrackingModeFollowWithCourse`. + + @param targetCoordinate The target coordinate to fit within the viewport. + @param animated If `YES`, the map animates to fit the target within the map + view. If `NO`, the map fits the target instantaneously. + */ +- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate animated:(BOOL)animated; + #pragma mark Configuring How the User Interacts with the Map /** |