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

make sure worker sends response after reloading 'empty' tile #7355

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

mollymerp
Copy link
Contributor

This is an alternative to #7348 to fix #7346 that does not require adding an additional tile state value, and prevents us from guessing whether a reload is necessary based on data returned from the initial worker parse. This is also nice because now the WorkerTile's loaded:{} object should match the tiles marked as state: 'loaded' in the foreground.

Prior to this, a reload request for a tile that 404'd or otherwise returned no data from the AJAX request would never call its callback and prevented map.loaded() from ever returning true due to tiles hanging with state: 'reloading'.

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

@@ -110,6 +110,8 @@ class VectorTileWorkerSource implements WorkerSource {
delete this.loading[uid];

if (err || !response) {
workerTile.status = 'done';
this.loaded[uid] = workerTile;

This comment was marked as resolved.

Copy link
Contributor

@ChrisLoer ChrisLoer left a comment

Choose a reason for hiding this comment

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

This looks right! 🍏

@mollymerp mollymerp merged commit 8b2da15 into master Oct 3, 2018
@mollymerp mollymerp deleted the empty-tile-reload branch October 3, 2018 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

map.loaded() returns "false" when setFilter() is used on a layer with missing tiles within the viewport
2 participants