python-visualization / python-visualization/folium
GlifyLayer not defined when using .add_to(map)
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 7.4k
- フォーク
- 2.3k
- 平均マージ
- 17時間 22分
- マージ済み PR(30日)
- 11
説明
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)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
GlifyLayer.ipynb から始めて、生成された HTML とブラウザコンソールを調査します。GlifyLayer.add_to(map) が L.glify.layer(options).addTo(...) の呼び出しと glify_layer_xxxxxx.addTo(...) の呼び出しの両方を生成する仕組みを、GlifyLayer init.py の実装も含めて追跡します。生成された HTML から 1 つのレイヤーセットアップが出力され、マップの残りの部分が ReferenceError なしで読み込まれれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100