小编Bra*_*ore的帖子

向 Folium 地图添加标题或文本

我想知道是否有办法在 python 中的大叶地图上添加标题或文本?

我有 8 张地图要显示,我希望用户无需单击标记即可知道他们正在查看哪张地图。我试图添加地图的图像,但不能,因为我没有足够高的声誉分数。

我的代码:

#marker cluster
corpus_chris_loc = [27.783889, -97.510556]

harvey_avg_losses_map = folium.Map(location = corpus_chris_loc, zoom_start = 5)

marker_cluster = MarkerCluster().add_to(harvey_avg_losses_map)

#inside the loop add each marker to the cluster
for row_index, row_values in harvey_losses.iterrows():

    loc = [row_values['lat'], row_values['lng']]
    pop = ("zip code: " + str(row_values["loss_location_zip"]) + "\nzip_avg: " + "$" + str(row_values['zip_avg'])) #show the zip and it's avg
    icon = folium.Icon(color='red')
    marker = folium.Marker(
        title = "Harvey: " + "$" + str(row_values['harvey_avg']),
        location = loc, 
        popup …
Run Code Online (Sandbox Code Playgroud)

html python data-visualization python-3.x folium

2
推荐指数
1
解决办法
4087
查看次数

标签 统计

data-visualization ×1

folium ×1

html ×1

python ×1

python-3.x ×1