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.

Animated MGLMapView methods should accept completion handlers #1581

Closed

Description

@1ec5

Methods like -[MGLMapView setCenterCoordinate:animated:] should have corresponding methods that take completion handlers (callback blocks) as parameters, like -[MGLMapView setCenterCoordinate:animated:completionHandler:]. Completion handlers feel much more natural in modern Objective-C and especially Swift, and they’d make it much easier to chain together animated changes to the map.

Activity

  1. added
    iOS
    on May 18, 2015
  2. added 2 commits that reference this issue on Sep 4, 2015
  3. jhoughjr commented on Sep 8, 2015

    @jhoughjr

    Here here!

  4. kdgwill-zz commented on Oct 6, 2015

    @kdgwill-zz

    Was their any further discussion on this, or does their at least exist a work around to determine when an mapbox animation has been completed?

  5. robipresotto commented on Oct 6, 2015

    @robipresotto

    +1

  6. added
    GL JS parity
    on Oct 6, 2015
  7. 1ec5 commented on Oct 6, 2015

    @1ec5
    ContributorAuthor

    GL JS can do this; so should the iOS SDK. The most straightforward way to implement it would be to have CameraOptions hold a C++ lambda that we can stuff the completion handler block into. Then easeTo() can plumb that through to the animation code’s completion code. I’m not sure what effect cancellation will have on this approach, though. For one thing, #2313 is still outstanding.

  8. added a commit that references this issue on Nov 6, 2015
  9. 1ec5 commented on Nov 20, 2015

    @1ec5
    ContributorAuthor

    does their at least exist a work around to determine when an mapbox animation has been completed?

    @kdgwill, -[MGLMapViewDelegate mapView:regionDidChangeAnimated:] is already available; it gets called for both programmatic and user-initiated region changes. It is possible to chain animations using that callback, but of course the completion handlers proposed here would be more convenient for that use case.

  10. added a commit that references this issue on Nov 20, 2015
    c65af8a
  11. self-assigned this
    on Nov 20, 2015
  12. added a commit that references this issue on Nov 25, 2015
    2de0a35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GL JS parityfeatureiOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions