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

Provide alpha levels for maps #1

Open
MichaelChirico opened this issue Oct 3, 2018 · 1 comment
Open

Provide alpha levels for maps #1

MichaelChirico opened this issue Oct 3, 2018 · 1 comment

Comments

@MichaelChirico
Copy link
Contributor

It's pretty easy to adjust the alpha level of the map if it's being used as a background, e.g.

alpha_to_hex = function(pct) sprintf('%02X', round(255*pct))

# bg_map: an OpenStreetMap object from openmap()
alpha = .5
if (alpha < 1) {
  alpha_hex = alpha_to_hex(alpha)
  for (tile_i in seq_along(bg_map$tiles))
    bg_map$tiles[[tile_i]]$colorData =
      paste0(bg_map$tiles[[tile_i]]$colorData, alpha_hex)
}

I'm not familiar enough with the Java interface to know if this can work at a lower level, but this seems to work pretty well from what I've been playing with thus far.

I'll file a PR if this sounds useful.

@ifellows
Copy link
Owner

ifellows commented Oct 3, 2018

sounds like it could be useful. Feel free to add a pull request

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