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

Arguments of event map:init doesn't contain map #38

Closed
olethanh opened this issue Sep 30, 2013 · 2 comments
Closed

Arguments of event map:init doesn't contain map #38

olethanh opened this issue Sep 30, 2013 · 2 comments

Comments

@olethanh
Copy link

Hi,

since 0.8.0 my map load to fail since when doing :
$(window).on('map:init', function (e) { ... });

'e' doesn't contain the 'map' attribute.

By looking a bit in the debugger it seems that new CustomEvent(type, data); [leaflet-extras.js:210] doesn't add the data to the evt.

This problem seems to have been introduced by c14ff11 (we are using jquery here)

@leplatrem
Copy link
Collaborator

From now on, if CustomEvent is available in the browser, I use it instead of JQuery, and vice-versa. This may be wrong indeed.
What do you think if I remove the else and fire both if both CustomEvent and jQuery are available ?

Will jQuery receive the CustomEvent in addition to the jQuery.Event ?
Could you please help me find out, using a jsfiddle or something ?

Thanks !

@leplatrem
Copy link
Collaborator

I just pushed a fix that should work in most cases (updated the example in README too).
If some problems persist, please try using the bundled events polyfills and let me know :)

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