Label rotation randomly not working
hupe13 opened this issue · 1 comments
hupe13 commented
Some things do not seem to work properly.
I think I have found the reason. I tested the same page with one elevation chart in Firefox and Chrome. The label rotation was random (yes or no), even in different tabs of the same browser. I changed the line
leaflet-elevation/src/handlers/labels.js
Line 11 in e0c68cb
to
this.on('elechart_init elechart_axis elechart_updated', function(e) {and the effect did not occur anymore. Not even with multiple charts with different rotations on the same page.
Raruto commented
The initial idea was to try to limit the number DOM mutations (perhaps feasible, but it would still require other thoughts..).
Anyway, something like this could suffice (I haven't tested):
this.on('elechart_updated', function(e) {Feel free to submit a pull request to close it.
👋 Raruto