python-visualization / python-visualization/folium

How to add a fixed position (in screen) static custom Text (html) like Legend

Aperta
#1,718 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Is your feature request related to a problem? Please describe.
Is there a way to just insert some overlay into the map with custom html code? Like legend but with descriptions or titles and such?

Describe the solution you'd like
There are clearly the elements like Layer control, Minimaps and such that are overlaid in the map, so I feel like there should be a way to put some boxes there with some custom contents. The contents can be static (generated from python string)

I'd prefer to do it with just a python string passed to some python function, without the need to write js or css ourselves if possible.

Describe alternatives you've considered

  • I've tried to make a jinja template and put the html file contents in a template, but didn't work with the html made from the map being something that needs to be inside iframe.
  • I tried to edit the html myself, but the map is generated from javacript.
  • I tried to add the element in the map.get_root() but it puts that on top, and if I use css to make it a overlay (I'm not good with it), then it somehow ends up below the map and invisible.

Additional context
I went through some issues thinking it should be there but didn't find anywhere.

https://github.com/python-visualization/folium/issues/86 says there used to be a custom map template you could make but it's gone now.
https://github.com/transport-nantes/tn_web/issues/135
https://github.com/python-visualization/folium/issues/781

Implementation
I'm not good with css or js, but I can do some python dev. If there is a easy way to just copy some parts from the LayerControl or such and add it, then I can help.

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 leggendo l’implementazione esistente di LayerControl e il punto di ingresso map.get_root() menzionato nell’issue, insieme alle issue precedenti collegate. Determina come posizionare sopra la mappa un overlay HTML statico fornito da Python senza richiedere JavaScript o CSS personalizzati. Il lavoro è completato quando la funzionalità funziona nell’output della mappa generata e supporta il contenuto a posizione fissa richiesto.

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

Valutazione

Stack tecnologico
css, html, javascript, python
Ambito
data-visualization, frontend, web-dev
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.