python-visualization / python-visualization/folium

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

Abierto
#1,718 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
7.4k
Forks
2.3k
Merge medio
17 h 22 min
PR fusionados (30 d)
11

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza leyendo la implementación existente de LayerControl y el punto de entrada map.get_root() mencionado en el issue, junto con los issues anteriores enlazados. Determina cómo debe posicionarse sobre el mapa una superposición HTML estática proporcionada por Python sin requerir JavaScript ni CSS personalizados. Se considera terminado cuando la funcionalidad funciona en la salida de mapa generada y admite el contenido con posición fija solicitado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
css, html, javascript, python
Área
data-visualization, frontend, web-dev
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.