-
Notifications
You must be signed in to change notification settings - Fork 52
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
mouseover event #4
Comments
Do you see the The code above should work and
gives you the I was able to bind a Hope this helps and thanks for your interest. |
Thank you for the quick response. Leaflet Hotline is a really nice Leaflet plugin. I've pushed your recommendation out to http://exploringspatial.com/#demo/10, but there is nothing in the log. It feels like a z-index issue. Over the next couple of days I'll get something put together on JsFiddle and we can see if that versions works okay. My demo page is very busy, so I can certainly imagine another div interfering somehow. |
I've built a demo on JSFiddle for you: https://jsfiddle.net/stevecmitchell/m18z71gc/. The mouseover events are not getting logged. Is that a bug, or is that something that I have done wrong? I build a second demo using the same version of Leaflet 1.0 Beta 2 and the same data, but uses a normal polyline instead. It works normally: https://jsfiddle.net/stevecmitchell/mLvjx8g5/. |
I swapped out the Beta 2 with the Beta 1 and the For a proper comparison you have to use a canvas renderer for the normal polyline. Leaflet.Hotline does this internally. You can switch to canvas renderers globally or just set it in the options of the polyline instance |
Thanks for all your help. I switched my polyline on JSFiddle to use L.canvas and Leaflet 1.0 Beta 2 and it still works (http://jsfiddle.net/stevecmitchell/mLvjx8g5/). Next, I switched the Hotline code to use Leaflet 1.0 Beta 1, and mouseover works now (http://jsfiddle.net/stevecmitchell/m18z71gc/). I rolled my demo site back to Leaflet 1.0 Beta 1, but that did not fix the mouseover on my Hotline demo there (http://exploringspatial.com/#demo/10). I'm going to table that issue for now since it works fine on JSFiddle. I've got to move on to Demo 11 now, a map editor, since the project that needs that is on deck. I'll revisit Leaflet Hotline soon. Several people that I've shown it to are very excited about what we can do with it. When I get free cycles I'll figure out why mouseover is not working on Demo 10. |
I'm not having any luck adding a mouseover event to L.hotline:
You can see in my demo, http://exploringspatial.com/#demo/10, that I am able to move a bullseye icon along the L.hotline when the user hovers over the Highcharts elevation chart. Now I need to do the reverse, highlighting points on the elevation chart when the user hovers the L.hotline.
How do I implement mouseover and mouseout with L.hotline?
Also, while we sort this out, I was going to added Leaflet Labels when hovering over the elevation chart. When I tried the preliminary branch of Leaflet Labels, Leaflet/Leaflet.label#121, it said that L.hotline was not defined. Once I removed Leaflet Labels hotline started working again.
The text was updated successfully, but these errors were encountered: