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

Opacity #222

Closed
dyardyGIT opened this issue Feb 4, 2019 · 8 comments
Closed

Opacity #222

dyardyGIT opened this issue Feb 4, 2019 · 8 comments

Comments

@dyardyGIT
Copy link

Is it possible to have multiple layers with an opacity on one and not the other?

i.e. bring in a street map with 100% opacity then bring in another layer at 50%

@ibrierley
Copy link
Collaborator

I think it depends, do you mean 2 separate complete maps over each other, or different layers within the same map ?

@dyardyGIT
Copy link
Author

I was wanting to add 2 layers and have one of them 50% transparent. This was my primary goal.

i.e.
layers:[
new TileLayerOptions(#1),
new TileLayerOptions(#2)
]

where layer #1 is 50% transparent.

thank you!

@johnpryan
Copy link
Collaborator

This isn't currently possible, sorry

@dyardyGIT
Copy link
Author

Is there any approach that would allow me to layer more than 1 layer? (do you see this as a feature you will be adding)?
We would like to have 1 layer for construction effort and another for street or satellite map. Embedding both in the offline tiles (pngs) is challenging for us.

Thanks again - Dave

@ibrierley
Copy link
Collaborator

Why not run 2 overlapping full maps (rather than layers)?

@johnpryan
Copy link
Collaborator

@dyardyGIT If you have the bandwidth, you could take a look at modifying this project to support that. I'm not totally opposed to adding an opacity option to the API, but there may be a way to support allowing arbitrary customizations to the tile layers, not just opacity

@ibrierley this could work, but would involve coordinating the two map positions, and could potentially lead to situations where they get out of sync

@jazzytomato
Copy link

There is a default backgroundColor set to grey with no transparency https://github.com/johnpryan/flutter_map/blob/3f54a36c87420efed16db0e475bac0849170bfae/lib/src/layer/tile_layer.dart#L109

Which is ok as default value for the first layer, but I wonder if it shouldn't just be completely transparent.

If the tile images of the second layer already have transparency, then setting the backgroundColor option explicitly should work.

new TileLayerOptions(backgroundColor: new Color.fromRGBO(0, 0, 0, 0)) // last parameter is alpha channel

@lordzyx
Copy link

lordzyx commented May 10, 2019

There is a default backgroundColor set to grey with no transparency

https://github.com/johnpryan/flutter_map/blob/3f54a36c87420efed16db0e475bac0849170bfae/lib/src/layer/tile_layer.dart#L109

Which is ok as default value for the first layer, but I wonder if it shouldn't just be completely transparent.

If the tile images of the second layer already have transparency, then setting the backgroundColor option explicitly should work.

new TileLayerOptions(backgroundColor: new Color.fromRGBO(0, 0, 0, 0)) // last parameter is alpha channel

yeah! working perfect with openstreetmap + openrailwaymap ! thank you!

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

5 participants