【发布时间】:2022-08-15 01:04:13
【问题描述】:
我想将 .explore 中标记的图标更改为房屋图标。
我已经阅读了geopandas.GeoDataFrame.explore 和folium 的文档,仍然无法理解。
geo_df.explore(m=m
,column=\'pop\'
,tooltip={\"name\",\"pop\"}
,cmap=\'summer\'
,style_kwds=dict(stroke=True,weight=1,color=\'black\', opacity=0.5, fillOpacity=0.9)
,marker_kwds=dict(radius=5,icon=folium.Icon(icon=\'house-blank\'))
,name=\"Residental\"
)
图标代表房子的位置,我根据整数值设置颜色图。
另外,有没有办法使缩放时半径大小不改变?
-
房子的图标不是“家”吗?我不知道它们是否都可用,但请参阅this 以获取图标列表。
icon=folium.Icon(icon=\'home\') -
我不确定在使用自定义标记时是否仍然可以使用
cmap,但为了使用folium标记,您必须通过设置marker_type=\'marker\'告诉geopandas 这样做:geo_df.explore(m=m ,column=\'pop\' ,marker_type=\'marker\' ,marker_kwds=dict(radius=5,icon=folium.Icon(icon=\'house-blank\')) ) -
似乎只接受
folium.map.Icons:geo_df.explore(m=m, marker_type=\'marker\', marker_kwds={\'icon\': folium.map.Icon(icon=\'home\', prefix=\'fa\')})
标签: python geopandas marker folium