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

Clip raster tiles #5105

Merged
merged 11 commits into from
Sep 20, 2017
Merged

Clip raster tiles #5105

merged 11 commits into from
Sep 20, 2017

Conversation

mollymerp
Copy link
Contributor

@mollymerp mollymerp commented Aug 5, 2017

JS counterpart to mapbox/mapbox-gl-native#9468

I still need to port mapbox/mapbox-gl-native#8769 and mapbox/mapbox-gl-native#8164 ( ticked #4257 ) in order for gl-js to actually request the tiles needed in order for the raster-masking render test to pass.

cc @kkaefer

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

@mollymerp
Copy link
Contributor Author

This is ready for review @kkaefer – I removed the depth testing per #5119 (comment)

@@ -67,8 +71,10 @@ class Tile {
placementSource: any;
workerID: number;
vtLayers: {[string]: VectorTileLayer};

mask: Array<number>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create an alias for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

...and could we potentially use ES6's Set for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to use an object to avoid precarious IE11 compatibility with Set

t.test('deep descendent masks', (t)=>{
const renderables = [ new Tile(0, 0, 0), new Tile(4, 4, 4)];
updateTileMasks(renderables);
t.deepEqual(renderables.map((r)=>{ return r.mask; }), [ [2, 34, 130, 2212, 2692, 2724, 611, 835, 867, 33, 65, 97], [0]]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of using numeric IDs here, can we please use TileCoord(z, x, y).id to make this more readable and comparable with Native?

// │ │ │
// └─────────────────┴─────────────────┘
//
// Only other renterable tiles that are *children* of the tile we are generating the mask for will
Copy link
Contributor

Choose a reason for hiding this comment

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

typo ;)

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.

2 participants