Reputation: 228
I have a code here that create a marker and put it in the map
var wholeinfo = "This is my message"
marker = L.marker([lat,long], {
icon: new L.AwesomeNumberMarkers({
number: '<font color="black" size = "1">' + code + '</font>',
markerColor: anyColor,
})}).bindPopup(wholeinfo).openPopup().on('click', markerOnClick).on('mouseover', openPopup());
markers.addLayer(marker);
I wonder how can I show the popup of that marker when i hover my pointer on it? then close when i remove my pointer. I try this but no luck
'mouseover', openPopup()
Upvotes: 1
Views: 1699
Reputation: 6546
Try to use
.on('mouseover', function (e) { this.openPopup(); })
.on('mouseout', function (e) { this.closePopup(); });
instead of
.on('mouseover', openPopup())
Upvotes: 1