python-visualization / python-visualization/folium
GlifyLayer not defined when using .add_to(map)
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 7.4k
- Forks
- 2.3k
- Merge médio
- 17h 22min
- PRs com merge (30d)
- 11
Descrição
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)
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com GlifyLayer.ipynb e inspecione o HTML gerado e o console do navegador. Rastreie como GlifyLayer.add_to(map) produz tanto a chamada L.glify.layer(options).addTo(...) quanto a chamada glify_layer_xxxxxx.addTo(...), incluindo a implementação de GlifyLayer init.py. Está concluído quando o HTML gerado emitir uma única configuração de camada e o restante do mapa carregar sem o ReferenceError.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, python
- Domínio
- data-visualization
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100