GlifyLayer not defined when using .add_to(map)
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, python
研究方向
從 GlifyLayer.ipynb 開始,檢查產生的 HTML 和瀏覽器主控台。追蹤 GlifyLayer.add_to(map) 如何同時產生 L.glify.layer(options).addTo(...) 呼叫和 glify_layer_xxxxxx.addTo(...) 呼叫,包括 GlifyLayer init.py 的實作。完成的標準是產生的 HTML 只輸出一個圖層設定,且地圖的其餘部分能在沒有 ReferenceError 的情況下載入。
由索引模型根據 Issue 內容生成。
描述
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)
- 主要語言
- Python
- 星號
- 7.4k
- 分支
- 2.3k
- 平均合併
- 17 小時 22 分鐘
- 30 天內合併 PR
- 11
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-visualization/folium 的其他 Issue
-
documentation
難度 2/5 1-3 小時 新手友好度 68/100
python-visualization/folium#2092 · 5 則留言 ·
-
難度 3/5 1-2 天 新手友好度 67/100
python-visualization/folium#2278 · 1 則留言 ·
-
難度 5/5 一週以上 新手友好度 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy 未關閉
難度 3/5 1-2 天 新手友好度 55/100
python-visualization/folium#2236 · 5 則留言 · 1 個 reaction ·
-
難度 5/5 一週以上 新手友好度 10/100
python-visualization/folium#2219 · 2 則留言 ·
查看 python-visualization/folium 的全部 Issue
相似的 Issue
-
essnmx good first issue
難度 1/5 1 小時以內 新手友好度 95/100
-
難度 2/5 1-3 小時 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 則留言 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未關閉area: repo bug perceived difficulty: 2
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
yeti-platform/yeti#1380 ·