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

allow region-based viewport setting #1092

Closed
incanus opened this issue Mar 25, 2015 · 7 comments · Fixed by #1783
Closed

allow region-based viewport setting #1092

incanus opened this issue Mar 25, 2015 · 7 comments · Fixed by #1783
Assignees
Labels
feature iOS Mapbox Maps SDK for iOS refactor
Milestone

Comments

@incanus
Copy link
Contributor

incanus commented Mar 25, 2015

#1082 and user location display on the map introduces -zoomToSouthWestCoordinate:northEastCoordinate:animated: brought over from the iOS SDK. We should settle on whether we will use this approach or a more singular structure like MapKit's MKRegion. Then, we should expose these methods publicly for general use as well for things like zooming to an array of annotations (the reason the new annotations don't have this yet).

Applies to all platforms, not just iOS.

@incanus
Copy link
Contributor Author

incanus commented Jun 1, 2015

#1655 is bringing in a LatLngBounds struct that we can use here. I think we should stick to coordinates like this rather than use another layer of abstraction like MapKit does (MKMapPoint & friends). I'll hit this when shapes land.

@incanus incanus self-assigned this Jun 1, 2015
@incanus
Copy link
Contributor Author

incanus commented Jun 2, 2015

Downside to not using an abstraction layer like MKMapPoint is that what we are specifying in "bounds" are actually spherical trapeziums, like how we do in the raster SDK, i.e. this is a shape that doesn't not have straight lines on the sides and the top and bottom edges are not the same length.

I don't think this is a problem in practice, but it does get into interesting territory when it comes to determining intersections and overlaps.

@incanus
Copy link
Contributor Author

incanus commented Jun 2, 2015

Coming along with the addition of this API would be something like MapKit's -showAnnotations:animated:, which allows passing annotation objects for viewport setting, which is super handy.

@incanus incanus mentioned this issue Jun 8, 2015
16 tasks
@incanus
Copy link
Contributor Author

incanus commented Jun 8, 2015

This isn't trivial, though, since you need to determine the region with regard to the view's current aspect ratio as well as possibly inset/offset padding.

@incanus incanus removed their assignment Jun 8, 2015
@friedbunny
Copy link
Contributor

Per #1433, -zoomToSouthWestCoordinate:northEastCoordinate:animated: is bork right now and doesn't behave as it should.

@1ec5
Copy link
Contributor

1ec5 commented Jun 23, 2015

This method should also be refactored to use MGLCoordinateBounds, which was introduced in #1655.

@1ec5 1ec5 self-assigned this Jun 23, 2015
@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label Jun 23, 2015
@1ec5 1ec5 mentioned this issue Jun 23, 2015
9 tasks
@1ec5
Copy link
Contributor

1ec5 commented Jun 23, 2015

I think we should stick to coordinates like this rather than use another layer of abstraction like MapKit does (MKMapPoint & friends).

MapKit’s geometry data types are named in parallel with Core Graphics geometry data types (MKMapPoint is to CGPoint as MKMapSize is to CGSize as MKMapRect is to CGRect). It’s elegant, but I agree that the additional level of abstraction isn’t necessary at this point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants