L.control on click to call a function

25 views
Skip to first unread message

Nandjm

unread,
Nov 25, 2024, 11:19:11 AM11/25/24
to Leaflet
Hello Everyone

I would like add a "mouse envet listener " to call a function on the page

L.Control.Angleterre = L.Control.extend(
{
options: {position: 'topleft'},
onAdd: function(map)
{
var img = L.DomUtil.create("img");
img.src = "Marqueurs/Angleterre.png";
img.title = 'English';
var a = L.DomUtil.create("a");
a.appendChild(img);
????   {'click',function() {SetLanguage(2);};}; ???

return a;
}
Would you agree to give me a little help?
Many thanks.
Best wishes

Jean Michel
Reply all
Reply to author
Forward
0 new messages