python-visualization / python-visualization/folium
Adding a colormap to a Layer or FeatureGroup
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 7.4k
- Forks
- 2.3k
- Ø Merge
- 17 Std. 22 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit tests/test_colormap_layer.py und führe das vorhandene Beispiel aus, um zu verstehen, wie Colormaps an GeoJson-, TopoJson- und FeatureGroup-Layer angehängt werden. Als erledigt gilt die Aufgabe, wenn die Colormap eines Layers diesem Layer in LayerControl folgt, beim Abwählen des Layers verschwindet und separate Layer separate Colormaps behalten können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100