[question] cluster tooltip
See original GitHub issuehello. I would like to know if there is a way to bind a on:hover
tooltip to the cluster marker.
I tried using Bootstrap tooltip in the html parameter of the iconCreateFunction
, but it doesn’t work.
var tooltip = '<a href="#" data-toggle="tooltip" data-original-title="I am a tooltip">cluster name</a>';
var cluster = new L.MarkerClusterGroup({showCoverageOnHover: true,
spiderfyOnMaxZoom: true,
iconCreateFunction: function (cluster)
{ return L.divIcon({ html: tooltip, className: 'tooltip', iconSize: L.point(40, 40) });}
});
/*add markers to the cluster*/
$('.tooltip').tooltip();
map.addLayer(cluster);
Thank you
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Possible to show aggregate votes in a tooltip on a ...
I'm building an interface that would take poll data in and show some results over a marker cluster using Mapbox but I don't...
Read more >How to add tooltips to each item of a cluster in Folium?
As stated in the question: "My goal is to add a tooltip to each item of the dataframe displaying its name." In your...
Read more >Tooltip on a Flared Cluster - Esri Community
I have a Feature Layer using a Weighted Cluster. I have been able to set the the Tooltip for the flared graphic, however...
Read more >How To Format Cluster Points - Map Region Point Layer
Hi, I would like to know how I can customize the tooltip for point clusters in a point layer on a map region....
Read more >Format Titles, Captions, Tooltips, and Legends - Tableau Help
You can show titles and captions on any sheet. Another option is to Add tooltips to marks. A legend card appears in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This code seems still functional with Leaflet 1.4.0 and Leaflet.markercluster 1.4.1:
Note: Either
.layer
and.propagatedFrom
would work for FeatureGroups likeL.markerClusterGroup
, but the former is deprecated since it was ambiguous for other types: https://github.com/Leaflet/Leaflet/pull/5880Another caveat is that with IE9, the tooltip is rapidly closed, potentially due to hovering over the tooltip element (which triggers clustermouseout). (This issue is also visible with tooltips on other layer elements, the tooltip.) If IE9 support is important (meh…), you could workaround that by setting tooltip options like:
Now that tooltips have been merged leaflet core, I am wondering what the recommended approach to adding tooltips is. Currently, I’m doing something like:
Is there a better way to do it?