Skip to main content
added tag for easybutton
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link
Gamze
  • 609
  • 2
  • 13
  • 23

Leaflet EasyButton MouseOver event

I am using easybutton plugin for leaflet. Is there a possibility to display an image+some text when mouse is over on the button?

Here is my current code:

 var btn2 = L.easyButton ({position: 'topright', 
  states: [{
    stateName: 'NoSources2',
    icon:'<img src=ico/closed_eye.png height="16" width="16"><span>   masquer le nombre de resources</span>',
      title: 'NoSources' ,
      onClick: function(control) {
                map.removeLayer(NoSources);
                control.state('NoSources1')},
    },
    {
     stateName: 'NoSources1',
    icon: '<img src=ico/oeil.jpg height="16" width="16"><span>   voir le nombre de resources</span>',
    title: 'NoSources',
    onClick: function(control)  {
    map.addLayer(NoSources);
    control.state('NoSources2')}, 
  }]
});
btn2.addTo(map);