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

allow region-based viewport setting #1092

Closed

Description

@incanus

#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.

Activity

  1. added this to the iOS Beta 2 milestone on Mar 25, 2015
  2. incanus commented on Jun 1, 2015

    @incanus
    ContributorAuthor

    #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.

  3. self-assigned this
    on Jun 1, 2015
  4. incanus commented on Jun 2, 2015

    @incanus
    ContributorAuthor

    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.

  5. incanus commented on Jun 2, 2015

    @incanus
    ContributorAuthor

    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.

  6. incanus commented on Jun 8, 2015

    @incanus
    ContributorAuthor

    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.

  7. removed their assignment
    on Jun 8, 2015
  8. friedbunny commented on Jun 10, 2015

    @friedbunny
    Contributor

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

  9. 1ec5 commented on Jun 23, 2015

    @1ec5
    Contributor

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

  10. self-assigned this
    on Jun 23, 2015
  11. added
    iOS
    on Jun 23, 2015
  12. 1ec5 commented on Jun 23, 2015

    @1ec5
    Contributor

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureiOSrefactor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions