GlifyLayer not defined when using .add_to(map)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, python
- Domain
- data-visualization
Research direction
Start with GlifyLayer.ipynb and inspect the generated HTML and browser console. Trace how GlifyLayer.add_to(map) produces both the L.glify.layer(options).addTo(...) call and the glify_layer_xxxxxx.addTo(...) call, including the GlifyLayer init.py implementation. Done means the generated HTML emits one layer setup and the rest of the map loads without the ReferenceError.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 2.3k
- Avg merge
- 17h 22m
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-visualization/folium
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-visualization/folium#2092 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
python-visualization/folium#2278 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
python-visualization/folium#2236 · 5 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
python-visualization/folium#2219 · 2 comments ·
All issues in python-visualization/folium
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·