Legend location in a DualMap
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Bắt đầu bằng cách chạy ví dụ DualMap được cung cấp trên folium 0.8.3 và lần theo các điểm vào add_to của DualMap, LayerControl và colormap. Được xem là hoàn tất khi mỗi ô bản đồ chỉ hiển thị chú giải được gán cho nó và có thể thay đổi vị trí của chú giải; không nêu tên tệp nào trong repository hoặc bài kiểm thử nào trong báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please add a code sample or a nbviewer link, copy-pastable if possible
# Your code here
# Add Dual-basemap
m = folium.plugins.DualMap(location=target_city, zoom_start = 9, tiles= 'openstreetmap')
# layer definition
layer_1= folium.features.Choropleth(
geo_data= gjson
,name= 'column_1'
,key_on='feature.properties.postcode'
,data= zipcodes_geom
,columns= ['postcode', 'column_1']
,fill_color='YlGnBu'
,highlight=True
,legend_name='column_1'
)
# popup window
tooltip_1= folium.features.GeoJsonTooltip(['postcode', 'column_1'])
layer_1.geojson.add_child(tooltip_1) # add it to the layer
#===========================================================================
layer_2= folium.features.Choropleth(
geo_data= gjson
,name= 'column_2'
,key_on='feature.properties.postcode'
,data= zipcodes_geom
,columns= ['postcode', 'column_2']
,fill_color='BuPu'
,highlight=True
,legend_name='column_2'
)
# popup window
tooltip_2 = folium.features.GeoJsonTooltip(['postcode', 'column_2'])
layer_2.geojson.add_child(tooltip_2) # add to the layer
#=============================================================
# dual map
# fg_both = folium.FeatureGroup(name='postcode_both').add_to(m)
fg_1= folium.FeatureGroup(name='column_1').add_to(m.m1)
fg_2= folium.FeatureGroup(name='column_2').add_to(m.m2)
layer_1.geojson.add_to(fg_1)
layer_2.geojson.add_to(fg_2)
# adding figure 1 and 2 to the basemap
fg_1.add_to(m.m1)
fg_2.add_to(m.m2)
#===========================
# add Layer control to Dual basemapa
# add legend for layer 1
folium.LayerControl(collapsed=True).add_to(m)
colormap_1= cm.linear.YlGnBu_06.scale(0,180)
colormap_1= colormap_1.to_step(index=[0,30,60,90,120,150,180])
colormap_1.caption= 'column_1'
colormap_1.add_to(m.m1)
# add legend for layer 2
colormap_2= cm.linear.PuBu_06.scale(0,180)
colormap_2= colormap_2.to_step(index=[0,14,29,43,58,72,87])
colormap_2.caption= 'column_2'
colormap_2.add_to(m.m2)
#===========================
# display map
display(m)
Problem description
Creating a Dual Map with two different geojson:
At the moment of adding the legends to the basemap (m), if I add one legend and define where to locate it could be grid 1(m.m1) or grid 2(m.m2) "It Works fine", but if I add the second legend, they get stack one on top of other, no mater that I assigned them to a different grid.
Also, It's there a way to move the legend to a different position in the basemap?
Expected Output
Would be that each grid of the Dual Map (basemap) contain one geojson and one legend.
Output of folium.__version__
0.8.3
- 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
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.
Issue khác của python-visualization/folium
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python-visualization/folium#2092 · 5 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
python-visualization/folium#2278 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
python-visualization/folium#2236 · 5 bình luận · 1 reaction ·
-
Touch Screen often fails Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
python-visualization/folium#2219 · 2 bình luận ·
Tất cả issue của python-visualization/folium
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·