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

fix start/finish rendering map delegate callbacks #1431

Closed
incanus opened this issue May 5, 2015 · 6 comments
Closed

fix start/finish rendering map delegate callbacks #1431

incanus opened this issue May 5, 2015 · 6 comments
Assignees
Labels
iOS Mapbox Maps SDK for iOS refactor
Milestone

Comments

@incanus
Copy link
Contributor

incanus commented May 5, 2015

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

@incanus incanus added iOS Mapbox Maps SDK for iOS refactor labels May 5, 2015
@incanus incanus added this to the iOS Beta 1 milestone May 5, 2015
incanus referenced this issue May 5, 2015
Add benchmarking application for iOS
@incanus
Copy link
Contributor Author

incanus commented May 5, 2015

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

@incanus incanus modified the milestones: iOS Beta 2, iOS Beta 1 May 5, 2015
This was referenced May 18, 2015
@incanus
Copy link
Contributor Author

incanus commented Jun 1, 2015

This is a regression currently from b1 to b2.

@jfirebaugh jfirebaugh modified the milestones: iOS Beta 3, iOS Beta 2 Jun 15, 2015
@friedbunny
Copy link
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

@friedbunny
Copy link
Contributor

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

@jfirebaugh jfirebaugh self-assigned this Jun 25, 2015
@jfirebaugh
Copy link
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.

@jfirebaugh
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

No branches or pull requests

3 participants