Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

GlifyLayer not defined when using .add_to(map)

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, python

Línea de trabajo

Comienza con GlifyLayer.ipynb e inspecciona el HTML generado y la consola del navegador. Sigue cómo GlifyLayer.add_to(map) produce tanto la llamada L.glify.layer(options).addTo(...) como la llamada glify_layer_xxxxxx.addTo(...), incluida la implementación de GlifyLayer init.py. La tarea está terminada cuando el HTML generado emite una única configuración de capa y el resto del mapa se carga sin el ReferenceError.

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

Descripción

not our bug work in progress

When using GlifyLayer.add_to(map) an error appears:

Uncaught ReferenceError: glify_layer_xxxxxx is not defined

The issue being that calling add_to(map) generates the function twice

L.glify.layer(options).addTo(map_xxxxxx); 
glify_layer_xxxxxx.addTo(map_xxxxxx);

This prevents the rest of the map loading correctly.

To Reproduce
This can be reproduced using the GlifyLayer.ipynb by saving the resultant html to file and inspecting console

Environment:

  • Python version 3.12.4
  • folium version 0.17.0

Possible solutions
A workaround I have been implementing is to directly change the HTML directly by setting

var glify_layer_xxxxxx = L.glify.layer(options);
glify_layer_xxxxxx.addTo(map_xxxxxx);

folium is maintained by volunteers. Can you help making a fix for this issue?
Unsure of where the generation of the 2nd function glify_layer_xxxxxx.addTo(map_xxxxxx); is taking place, clearly not in init.py for GlifyLayer (Maybe constructor for GlifyLayer, but cannot be sure)

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

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.

Más de python-visualization/folium

Todos los issues de python-visualization/folium

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.