Leaflet.Tooltip
Leaflet.Tooltip copied to clipboard
watch _source changes
It would be very useful to let the tooltip behaving as the referenced source (as it happens for popus). For example, given the following example:
var m = L.marker([46, 11.2]).addTo(map);
var t = L.tooltip({position: 'right', noWrap: true }, m)
.setContent('Test')
.addTo(map)
.setLatLng(new L.LatLng(46, 11.2));
setTimeout(function(){
map.removeLayer(m);
}, 5000);
When the marker is added/removed to/from the map, the tooltip is added/removed as well.