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

Feature request: ability to set default out-of-bounds background color #9

Open
wilkesreid opened this issue Dec 19, 2016 · 2 comments

Comments

@wilkesreid
Copy link

My map, which has an opaque white background, shows the following when being tiled at its edge:

map edge

It's a bit hard to tell, but this is a square image with the white background of the map's right edge, and the black is the background that is automatically added by TileUp when in order to make the image square.

Could we have some option to specify that color and/or to make it transparent if exporting in a file format that supports transparency (e.g. PNG)?

@wilkesreid
Copy link
Author

Lines 137 - 148 of tiler.rb:

    # unless told to do otherwise, extend tiles in the last row and column
    # if they do not fill an entire tile width and height.
    
    is_edge = (c[:row] == num_rows - 1 || c[:column] == num_columns - 1)
    needs_extension = ci.rows != tile_height || ci.columns != tile_width
    if @options.extend_incomplete_tiles && is_edge && needs_extension
      # defaults to white background color, but transparent is probably 
      # a better default for our purposes.
      ci.background_color = "none"
      # fill to width height, start from top left corner.
      ci = ci.extent(tile_width, tile_height, 0, 0)
    end

I think choosing to set the background color to "none" in all cases is causing the black background when exporting to filetypes that do not support transparency (e.g. JPEG).

@moiristo
Copy link

Hi,

Just fyi, I added this to my fork of tileup: https://github.com/moiristo/tileup

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

No branches or pull requests

2 participants