-
Notifications
You must be signed in to change notification settings - Fork 74
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
Allow showing partial tiles on the edges of an image or map. #606
Conversation
If the tileLayer tilesMaxBounds function is defined, some tiles may be cropped. Tile cropping is implemented in the gl, canvas, and null renderers (but not d3).
'void main(void) {', | ||
' mediump vec4 color = texture2D(sampler2d, iTextureCoord);', | ||
' if (iTextureCoord.s > crop.s || 1.0 - iTextureCoord.t > crop.t) {', | ||
' return;', |
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 think discard would be a better option here.
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.
Thanks.
@manthey so this is only going to crop towards right and bottom? What happens to the cropping towards left and top? |
Current coverage is 81.71% (diff: 100%)@@ master #606 diff @@
==========================================
Files 82 82
Lines 7442 7482 +40
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6071 6114 +43
+ Misses 1371 1368 -3
Partials 0 0
|
@aashish24 Yes, currently all tile sets I know of have the 0, 0 pixel within a tile, so only right and bottom cropping is necessary. All partial-tile examples I have are from medical images, and this satisfies the need there. If you have a real-world tile set which has partial tiles on the top or left, then we can add support at that time. |
If the tileLayer tilesMaxBounds function is defined, some tiles may be cropped. Tile cropping is implemented in the gl, canvas, and null renderers (but not d3).
This fixes issue #544.