-
Notifications
You must be signed in to change notification settings - Fork 256
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
Google map poly mouse* events not working #242
Comments
You should not need to call |
try this one http://jsbin.com/letani/edit?html,output and move mouse over the line, Then try uncomment my version of google-map-poly import, comment out original and move mouse over polyline again, see messages in the console. Seems like _mouseEventsChanged is called when this.poly is not defined yet. |
@ebidel did you have a chance to look at jsbin added? Please let me know if I need to improve it somehow. Thanks |
Probably won't have a chance until after the holidays. On Tue, Dec 22, 2015, 5:19 PM Andrey Stelmashenko notifications@github.com
|
I'm having exactly the same issue. Actually, it affects almost all properties in this component. The problem is property observers have an implicit dependency on the order they are being called. Observers of almost all properties assume that this.poly should be already created, while it's created in the _mapChanged observer. |
Most likely the simplest way to resolve the issue is to create polygon/polyline instance on the ready() event with all required properties |
Actually, because of the way map is set on the component, we anyway need to explicitly forward all required events in the _createPoly method or click-events, mouse-events and drag-events will be ignored when map is changed. I created a PR with the change and a test: #248 |
@ebidel can you take a look on this, please? in some cases (like two-way binding driven map objects population) workarounds become too cumbersome and difficult to maintain, while this looks like an obvious bug in the component |
I haven't had a chance to look at your PR (#248). Does that address this bug? |
Yes, it does. |
yep, it's the fix for this issue |
Hi,
Thanks for developing this polymer element. I need mouse* events enabled but I could not get them working, I noticed that _mouseEventsChanged is not called and listeners are not added. If I call _mouseEventsChanged at the end of _createPoly function, mouse events become working.
B.t.w. I've implemented google-map-circle, the same way as google-map-poly, and got the same issue there.
The text was updated successfully, but these errors were encountered: