Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awesome-markers and click #81

Open
powpowland opened this issue Dec 9, 2016 · 1 comment
Open

awesome-markers and click #81

powpowland opened this issue Dec 9, 2016 · 1 comment

Comments

@powpowland
Copy link

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 :

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 ?

@johncadengo
Copy link

@powpowland did you ever get this to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants