Open powpowland opened 7 years ago
Hello,
I need an action when I click on a marker but I have that error : TypeError: listeners[i].action is undefined
TypeError: listeners[i].action is undefined
This is my code :
var mark1 = L.marker([45.21996,6.22247], {icon: L.AwesomeMarkers.icon({icon: 'glass', prefix: 'fa', markerColor: 'red'}) }); mark1.addTo(map).bindPopup("<b>You're here</b>"); var mark2 = L.marker([45.21763,6.21749], {icon: L.AwesomeMarkers.icon({icon: 'glass', prefix: 'fa', markerColor: 'gray'}) }); mark2.addTo(map).bindPopup("<b>You're not here</b>"); function onMarkerClick(text) { alert('test '+text); } mark1.on('click', onMarkerClick('abc')); mark2.on('click', onMarkerClick('efg'));
Could you help me please ?
@powpowland did you ever get this to work?
Hello,
I need an action when I click on a marker but I have that error :
TypeError: listeners[i].action is undefined
This is my code :
Could you help me please ?