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

Ensure correct type of event.element #5926

Merged
merged 1 commit into from Oct 2, 2016

Conversation

adube
Copy link
Contributor

@adube adube commented Sep 30, 2016

This PR adds a cast around a event.element, the event being a ol.Collection.Event.

I don't know why, but when I use Closure-util, the line returns an error:

info closure-util Reading build config
info closure-util Getting Closure dependencies
info closure-util Compiling 296 sources
ERR! compile 
node_modules/openlayers/src/ol/map.js:445: ERROR - Property getId never defined on ol.Collection.Event.element
ERR! compile         var id = event.element.getId();

The native build within ol3 works fine with or without casting the type of element. I don't understand what's going on as I use the exact same configuration for the build. Also, why only this line? If you look just above, there are other places where event.element are used without casting the element and that works just fine. This one is picky, so this PR fixes this. It doesn't impact anyting from the actual code, just making Closure-util stop complaining about it.

Ready for review.

@ahocevar
Copy link
Member

ahocevar commented Oct 2, 2016

Thanks @adube. Similar casts are done elsewhere, so let's just merge this.

@ahocevar ahocevar merged commit 09eee4a into openlayers:master Oct 2, 2016
@adube adube deleted the fix-map-collection-element-type branch October 7, 2016 15:39
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

Successfully merging this pull request may close these issues.

None yet

2 participants