Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'idle' event: fires when no further rendering is expected without further interaction. #7625

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

ChrisLoer
Copy link
Contributor

@ChrisLoer ChrisLoer commented Nov 27, 2018

We fairly frequently receive requests for a map event that fires when the map is "done rendering". This is a kind of squishy concept because so many things can cause the map to change. Even if there's no user interaction with the map, tiles can update at any time and trigger map updates. However, we have a pretty good idea of when we're entering an idle state:

  • All requested tiles are loaded
  • No transitions are in progress
  • No camera animations are in progress

This PR fires an idle event in that condition. One reason someone might want to use this event is to make changes to the map, and then do a canvas capture after everything has finished rendering.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

cc @kkaefer @1ec5 @tmpsantos @mourner @ryanhamley @mollymerp

Copy link
Contributor

@ryanhamley ryanhamley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 looks good

Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior art #2471

I do think this kind of event is something we should add to the library – we've previously discussed calling it renderend or renderstable. My vote is for renderend because of the precedent of zoomend etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants