ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

Marker title attribute has no effect

Open giswqs opened this issue 3 years ago • 2 comments

The documentation says that Marker has the title attribute for setting the tooltip, but it has no effect. Hoving over the marker does not show the tooltip.

https://ipyleaflet.readthedocs.io/en/latest/api_reference/marker.html image

from ipyleaflet import Map, Marker

center = (52.204793, 360.121558)

m = Map(center=center, zoom=15)

marker = Marker(location=center, draggable=False)
marker.title = "This is tooltip"
m.add_layer(marker);

m

giswqs avatar Oct 03 '21 14:10 giswqs

duplicate of - https://github.com/jupyter-widgets/ipyleaflet/issues/676 ?

sackh avatar Oct 04 '21 05:10 sackh

I was looking for an ipyleaflet feature similar to the folium Marker tooltip attribute as shown below. I am not sure if it is feasible.

App: https://share.streamlit.io/dansbecker/weather-analytics/main Code: https://github.com/dansbecker/weather-analytics/blob/main/streamlit_app.py#L125

        folium.CircleMarker(location=[city.lat, city.lon],
                    tooltip=f"{city.municipality}\n  value: {city[field_to_color_by]}{metric_unit}",
                    fill=True,
                    fill_color=icon_color,
                    color=None,
                    fill_opacity=0.7,
                    radius=5,
                    popup = folium.Popup().add_child(
                                            folium.features.VegaLite(city_graph)
                                            )
                    ).add_to(main_map)

giswqs avatar Oct 04 '21 20:10 giswqs