-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Clip raster tiles #5105
Conversation
58c2254
to
01ce24f
Compare
b524ea0
to
c87a92d
Compare
c87a92d
to
9095b3e
Compare
b0cba75
to
2f07a46
Compare
This is ready for review @kkaefer – I removed the depth testing per #5119 (comment) |
2f07a46
to
c1efd53
Compare
src/source/tile.js
Outdated
@@ -67,8 +71,10 @@ class Tile { | |||
placementSource: any; | |||
workerID: number; | |||
vtLayers: {[string]: VectorTileLayer}; | |||
|
|||
mask: Array<number>; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
test/unit/source/tile_mask.test.js
Outdated
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]]); |
There was a problem hiding this comment.
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?
src/render/tile_mask.js
Outdated
// │ │ │ | ||
// └─────────────────┴─────────────────┘ | ||
// | ||
// Only other renterable tiles that are *children* of the tile we are generating the mask for will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo ;)
fix doc lint
fix bugs in the masking algorithm perform masking on raster tile loads clean up
clean up PR
c1efd53
to
c72d9c0
Compare
c72d9c0
to
69a347b
Compare
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