python-visualization / python-visualization/folium

How to add a fixed position (in screen) static custom Text (html) like Legend

オープン
#1,718 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
7.4k
フォーク
2.3k
平均マージ
17時間 22分
マージ済み PR(30日)
11

説明

Is your feature request related to a problem? Please describe.
Is there a way to just insert some overlay into the map with custom html code? Like legend but with descriptions or titles and such?

Describe the solution you'd like
There are clearly the elements like Layer control, Minimaps and such that are overlaid in the map, so I feel like there should be a way to put some boxes there with some custom contents. The contents can be static (generated from python string)

I'd prefer to do it with just a python string passed to some python function, without the need to write js or css ourselves if possible.

Describe alternatives you've considered

  • I've tried to make a jinja template and put the html file contents in a template, but didn't work with the html made from the map being something that needs to be inside iframe.
  • I tried to edit the html myself, but the map is generated from javacript.
  • I tried to add the element in the map.get_root() but it puts that on top, and if I use css to make it a overlay (I'm not good with it), then it somehow ends up below the map and invisible.

Additional context
I went through some issues thinking it should be there but didn't find anywhere.

https://github.com/python-visualization/folium/issues/86 says there used to be a custom map template you could make but it's gone now.
https://github.com/transport-nantes/tn_web/issues/135
https://github.com/python-visualization/folium/issues/781

Implementation
I'm not good with css or js, but I can do some python dev. If there is a easy way to just copy some parts from the LayerControl or such and add it, then I can help.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、既存の LayerControl の実装と、issue で言及されているエントリポイント map.get_root() を、リンクされている過去の issue と併せて読みます。Python から提供される静的な HTML オーバーレイを、カスタム JavaScript や CSS を必要とせずに地図の上に配置する方法を判断します。生成された地図の出力で機能が動作し、要求された固定位置のコンテンツをサポートできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
css, html, javascript, python
領域
data-visualization, frontend, web-dev
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。