python-visualization / python-visualization/folium
How to add a fixed position (in screen) static custom Text (html) like Legend
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 7.4k
- Fork
- 2.3k
- Merge trung bình
- 17 giờ 22 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách đọc triển khai LayerControl hiện có và điểm vào map.get_root() được đề cập trong issue, cùng với các issue trước đó được liên kết. Xác định cách đặt một lớp phủ HTML tĩnh do Python cung cấp lên trên bản đồ mà không yêu cầu JavaScript hoặc CSS tùy chỉnh. Hoàn tất có nghĩa là tính năng hoạt động trong đầu ra bản đồ được tạo và hỗ trợ nội dung có vị trí cố định được yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- css, html, javascript, python
- Lĩnh vực
- data-visualization, frontend, web-dev
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100