python-visualization / python-visualization/folium

Adding a colormap to a Layer or FeatureGroup

Aperta
#399 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Python
Stelle
7.4k
Fork
2.3k
Merge medio
17h 22m
PR unite (30g)
11

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da tests/test_colormap_layer.py ed esegui l’esempio esistente per capire come vengono associati i colormaps ai layer GeoJson, TopoJson e FeatureGroup. Il lavoro è completato quando il colormap di un layer segue quel layer in LayerControl, scompare quando il layer viene deselezionato e layer separati possono mantenere colormaps separati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, python
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.