-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Is there a way to add colormap to LayerControl? #450
Comments
In fact a |
@BibMartin Thanks for the reply! I certainly will not be able to implement it, since my Java Script knowledge is zero. I just found similar question here http://gis.stackexchange.com/questions/68941/how-to-add-remove-legend-with-leaflet-layers-control with an answer [EDIT, Oh I see it's basically what you have suggested]. Maybe it will help. Anyway I think this issue now can be turned to feature quest I guess :) |
True. And that would be a useful feature btw. Thanks for the idea and for the link 😉 |
Just to be fair |
Thanks to your link @koldunovn , I finally found a way of doing it. See here. But I don't know where it should be put:
Well this is open to discussion (and to volunteers for a PR 😉 ) |
@BibMartin This is just amasing! Exactly what I need! |
@BibMartin thank you for your answer that was also helpful for me. |
@BibMartin merci ! |
Hello! Thanks for a solution, but don't you know, is there a way to make different layers with different colormaps as not overlay layers? So at the moment, there would be only one layer with only one colormap. If I change overlay statuses in your function, the map won't work properly. |
Try changing the trigger in @BibMartin 's code from |
Sadly this is not working for me when my colorbar is an image added with FloatImage |
Hey! I'm creating a categorical legend like this:
Any idea how I can change your code for the |
@BibMartin solution used to work just fine in folium v0.14.0 but since I updated to v0.15.1 all my colormaps are initially displayed ... just like layeradd and layerremove events were not initially fired. Then interacting with Layer Control it starts working fine. Has anybody else encountered such an issue ? |
@berrfred I have encountered the same issue - all my colormaps are initially displayed, but then once the bound FeatureGroup is toggled on and off again, it works as normal. Would ideally like it to be initially hidden, and only displayed once the overlay for the bound FeatureGroup is toggled "on". I can't seem to find a suitable "show=False" parameter for the Colormap or the add_child method that would seem to be the key. |
@berrfred I'm also having this issue, I'm going to try to find a way to change that (though it's low on my priority list). I'll let y'all know if anything comes of it. |
First of all incredible progress from the last time I have checked folium, my respect to the team!
I am trying to use some examples from Colormaps.ipynb and it seems like the colormap is not recognised by the LayerControl as one of the layers. My question have two parts:
At the end I would like to have 2 layers on one map, but they should have different colormaps.
The text was updated successfully, but these errors were encountered: