首页 > 解决方案 > MarkerCluster does not have a tooltip feature I would like to use the Hover option to display details on clusters in python language using Folium

问题描述

When I Hover-over the cluster I could see the details I need.. I set the clusters in a way they can be displayed in the form of clusters, region, district.. I need to show tooltips on every cluster according to my need. #####################################################################

import folium

from folium.plugins import MarkerCluster

import folium.plugins as plugins


cluster = df[["B_lat", "B_long"]].values.tolist()


MC = folium.plugins.MarkerCluster(name="MC", loc=cluster, tooltip="pakistan").add_to(
    map_osm
)


if df["B_Balance"][point] < 50000:
    folium.Marker(
        all_location_list[point],
        popup="Branchname:"
        + df["Branch_name"][point]
        + " Balance:"
        + df["B_Balance"][point].astype(str),
        tooltip="Branchname:"
        + df["Branch_name"][point]
        + "<br>Balance:"
        + df["B_Balance"][point].astype(str),
        icon=folium.Icon(
            color="darkblue",
            icon_color="white",
            icon="university",
            angle=0,
            prefix="fa",
        ),
    ).add_to(MC)

标签: pythonfolium

解决方案


推荐阅读