Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Implement camera API #1834

Closed
incanus opened this issue Jul 5, 2015 · 3 comments
Closed

Implement camera API #1834

incanus opened this issue Jul 5, 2015 · 3 comments
Assignees
Labels
feature GL JS parity For feature parity with Mapbox GL JS

Comments

@incanus
Copy link
Contributor

incanus commented Jul 5, 2015

We need a camera-like API that allows not only timing curves for viewport changes, but also setting multiple properties simultaneously. Tickets forthcoming, but right now, you can't change both the center/zoom and the heading at the same time, but animated.

Apple MapKit's MKMapCamera API is nice model here, which can later be extended for pitch as well.

@incanus incanus added feature GL JS parity For feature parity with Mapbox GL JS labels Jul 5, 2015
@1ec5
Copy link
Contributor

1ec5 commented Jul 5, 2015

cc @jfirebaugh, who was looking at ways to implement this at the mbgl level.

@jfirebaugh
Copy link
Contributor

We recently rationalized this on the gl-js side so that camera methods like jumpTo, easeTo, and flyTo all take the same options object of camera parameters (center, zoom, bearing, and pitch). Any omitted parameter defaults to the current value. We should port these method names and parameter conventions to native, although instead of a generic object we'll need to have something like:

struct CameraOptions {
    optional<LatLng> center;
    optional<float> zoom;
    optional<float> bearing;
    optional<float> pitch;
};

Related: #256.

@friedbunny friedbunny changed the title mirror camera API Implement camera API Jul 10, 2015
@1ec5 1ec5 self-assigned this Jul 28, 2015
1ec5 added a commit that referenced this issue Jul 30, 2015
@1ec5
Copy link
Contributor

1ec5 commented Jul 30, 2015

I’ve started to unify some of the Transform methods to funnel into a single method that handles animation. Work is taking place on the 1ec5-camera-1834 branch. I’ve left out pitch for now, since that is unimplemented.

The eventual Cocoa Touch API will probably use different terminology than what we’ve used up to this point: per MKMapCamera, we’ll probably have fields called centerCoordinate, heading (instead of rotation), pitch, and altitude (instead of zoom). Who knows, someday we may also want a bank property too.

1ec5 added a commit that referenced this issue Aug 14, 2015
Added course-tracking. However, rotation has to happen atomically without animation until #1834 is fixed.

Fixes #1605.
1ec5 added a commit that referenced this issue Aug 21, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
1ec5 added a commit that referenced this issue Aug 21, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
@bleege bleege mentioned this issue Aug 24, 2015
1ec5 added a commit that referenced this issue Aug 25, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
1ec5 added a commit that referenced this issue Aug 25, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
1ec5 added a commit that referenced this issue Aug 26, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
1ec5 added a commit that referenced this issue Aug 27, 2015
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. Cleanup shall commence shortly.

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.

ref #1834
@1ec5 1ec5 mentioned this issue Aug 28, 2015
14 tasks
1ec5 added a commit that referenced this issue Sep 4, 2015
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.
@1ec5 1ec5 closed this as completed in 0a172a2 Sep 7, 2015
AndwareSsj pushed a commit to AndwareSsj/mapbox-gl-native that referenced this issue Nov 6, 2015
Added course-tracking. However, rotation has to happen atomically without animation until mapbox#1834 is fixed.

Fixes mapbox#1605.
AndwareSsj pushed a commit to AndwareSsj/mapbox-gl-native that referenced this issue Nov 6, 2015
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 mapbox#1643, fixes mapbox#1834. Ref mapbox#1581.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

3 participants