python-visualization / python-visualization/folium
Adding a colormap to a Layer or FeatureGroup
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 2.3k
- Avg merge
- 17h 22m
- Merged PRs (30d)
- 11
Description
Hopefully, this is just a case of I'm-Doing-It-Wrong.
I'd like to be able to associate a colormap with a specific layer (e.g. GeoJson or TopoJson layer), independently of say, another layer of just markers or just a different choropleth layer. This way, if I deselect a layer in the LayerControl, both the GeoJson layer and the associated colormap go away (which also lets me have a separate colormap per Geo/TopoJson layer).
I've tried adding the colormap to the layer itself as well as adding both the layer and colormap to a FeatureGroup, but neither of these approaches seem to work.
Have a look at: https://github.com/eddies/folium/blob/59f88bca397a600b138abfc21591373ac3a66a78/tests/test_colormap_layer.py for an example (sorry, it's not a Jupyter notebook--long story about problems w/ Jupyter and virtualenvs)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/test_colormap_layer.py and run the existing example to understand how colormaps are attached to GeoJson, TopoJson, and FeatureGroup layers. Done means a layer's colormap follows that layer in LayerControl, disappearing when the layer is deselected, while separate layers can retain separate colormaps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100