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

Allow showing partial tiles on the edges of an image or map. #606

Merged
merged 4 commits into from
Aug 10, 2016

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Aug 9, 2016

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.

manthey added 2 commits August 9, 2016 11:48
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;',
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.

@aashish24
Copy link
Member

@manthey so this is only going to crop towards right and bottom? What happens to the cropping towards left and top?

@codecov-io
Copy link

codecov-io commented Aug 10, 2016

Current coverage is 81.71% (diff: 100%)

Merging #606 into master will increase coverage by 0.13%

@@             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          

Powered by Codecov. Last update fde443f...44b5cd0

@manthey
Copy link
Contributor Author

manthey commented Aug 10, 2016

@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.

@manthey manthey merged commit f525f1e into master Aug 10, 2016
@manthey manthey deleted the no-render-beyond-bounds branch August 10, 2016 19:31
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.

3 participants