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

cameraThatFitsCoordinateBounds #4790

Merged
merged 1 commit into from
Apr 22, 2016
Merged

cameraThatFitsCoordinateBounds #4790

merged 1 commit into from
Apr 22, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Apr 22, 2016

Added an API to get a camera that you can pass into -[MGLMapView setCamera:] that fits the given coordinate bounds, by analogy with -[MKMapView regionThatFits:] or -[MKMapView mapRectThatFits:edgePadding:].

Added mbgl::Map::getCameraOptions() for getting the current camera options in fewer lines of code – less opportunity to forget a field.

@friedbunny, can you double-check that I haven’t flubbed anything with respect to edge insets / padding?

@1ec5 1ec5 self-assigned this Apr 22, 2016
@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS Core The cross-platform C++ core, aka mbgl labels Apr 22, 2016
@1ec5 1ec5 added this to the ios-v3.3.0 milestone Apr 22, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 22, 2016

Note that the result of -cameraThatFitsCoordinateBounds: still isn’t quite perfect when the map is tilted, due to #2259.

@1ec5 1ec5 mentioned this pull request Apr 22, 2016
@1ec5 1ec5 force-pushed the 1ec5-camera-fit branch 2 times, most recently from 783d633 to e7aac28 Compare April 22, 2016 22:46
Added an API to get a camera that you can pass into -[MGLMapView setCamera:] that fits the given coordinate bounds, by analogy with -[MKMapView regionThatFits:] or -[MKMapView mapRectThatFits:edgePadding:].

Added mbgl::Map::getCameraOptions() for getting the current camera options more conveniently.
@1ec5 1ec5 merged commit 466ed55 into master Apr 22, 2016
@1ec5 1ec5 deleted the 1ec5-camera-fit branch April 22, 2016 23:55
1ec5 added a commit that referenced this pull request Apr 23, 2016
Followup to #4790. Fixed a regression preventing the direction and pitch from being persisted across sessions.
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 23, 2016

df0d118 fixes a regression this change introduced that prevented the map’s previous direction and pitch from being persisted by state restoration. Thankfully, centralizing this code means we don’t have to do so much of this conversion anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant