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.

fix start/finish rendering map delegate callbacks #1431

Closed

Description

@incanus

Per fab65e7#commitcomment-11046360, the MapChangeWillStartRenderingMap and MapChangeDidFinishRenderingMap notification types are meant to drive delegate callbacks which have parity with Apple's MapKit. These callbacks are meant to relate to the visual appearance of render, not anything frame-based, so that common iOS post-view-load techniques can be employed.

  • Capturing a snapshot of a fully-rendered complex view for use with Core Image/blur filters for view transition effects.
  • Not presenting the map view until it's completely tiled in (we've had requests for this before from partners for raster use cases).
  • Determining when an incomplete map view might be shown, but no more attempts to load anything will be happening (fullyRendered: NO).

Some MapKit background:

The map view calls this method when one or more tiles are revealed and require rendering.

[...]

This method lets you know when the map view finishes rendering all of the currently visible tiles to the best of its ability. This method is called regardless of whether all tiles were rendered successfully. If there were errors loading one or more tiles that prevented map view from rendering them, the fullyRendered parameter is set to NO.

Calling these sorts of methods per-frame is not useful to users, either, because any work done in there will impact the render frame rate.

If we need additional callbacks such as something like MapChangeDidRenderFrame, we should make and use them instead, optionally also exporting them to Cocoa.

/cc @kkaefer

Activity

  1. added
    iOS
    on May 5, 2015
  2. added this to the iOS Beta 1 milestone on May 5, 2015
  3. added a commit that references this issue on May 5, 2015
  4. incanus commented on May 5, 2015

    @incanus
    ContributorAuthor

    Per chat we are moving this to b2 and not updating anything else around delegates — known bug that they no longer work like MapKit.

  5. modified the milestones: iOS Beta 2, iOS Beta 1 on May 5, 2015
  6. incanus commented on Jun 1, 2015

    @incanus
    ContributorAuthor

    This is a regression currently from b1 to b2.

  7. friedbunny commented on Jun 24, 2015

    @friedbunny
    Contributor

    Seeing isChanging still firing after didChange:

    2015-06-23 17:40:30.148 Mapbox GL[46461:4773694] will: z5.381543; 52.421373, 9.766954
    2015-06-23 17:40:30.149 Mapbox GL[46461:4773694] is: z6.381543; 52.413178, 9.766322
    2015-06-23 17:40:30.260 Mapbox GL[46461:4773694] is: z6.381543; 52.104201, 9.742608
    2015-06-23 17:40:30.260 Mapbox GL[46461:4773694] is: z6.381543; 52.104201, 9.742608
    2015-06-23 17:40:30.260 Mapbox GL[46461:4773694] is: z6.381543; 52.104201, 9.742608
    2015-06-23 17:40:30.367 Mapbox GL[46461:4773694] is: z6.381543; 52.046701, 9.738212
    2015-06-23 17:40:30.368 Mapbox GL[46461:4773694] is: z6.381543; 52.046701, 9.738212
    2015-06-23 17:40:30.477 Mapbox GL[46461:4773694] is: z6.381543; 52.036550, 9.737437
    2015-06-23 17:40:30.623 Mapbox GL[46461:4773694] did: z6.381543; 52.036550, 9.737437
    2015-06-23 17:40:30.802 Mapbox GL[46461:4773694] is: z6.381543; 52.036550, 9.737437
    2015-06-23 17:40:30.971 Mapbox GL[46461:4773694] is: z6.381543; 52.036550, 9.737437
    

    ^ zoom; lat, long

  8. friedbunny commented on Jun 24, 2015

    @friedbunny
    Contributor

    Tapping on the map also triggers an isChanging notification. (And only isChanging.)

  9. self-assigned this
    on Jun 25, 2015
  10. jfirebaugh commented on Jun 26, 2015

    @jfirebaugh
    Contributor

    @friedbunny, if you're after region change notifications, I think you wanted #1026. This ticket is about rendering notifications.

    Now, as far as I can tell, b1 never sent *RenderingMap notifications, and b2 sends them but with non-MapKit semantics. @incanus, is this what you meant by regressing?

    bab66c1 lays some groundwork and bd901d2 rationalizes *RenderingMap -- but not in the way we want. I'll probably rename these notifications to *RenderingFrame as suggested above, and then work on notifications with the MapKit semantics.

  11. jfirebaugh commented on Jun 30, 2015

    @jfirebaugh
    Contributor

    Done in 6532438.

    What remains unimplemented is support for fullyRendered:NO -- we currently do not surface tile errors in a way that made this easy to implement, so I'm punting for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSrefactor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions