Closed hupe13 closed 1 year ago
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
https://github.com/Raruto/leaflet-elevation/pull/252#issuecomment-1528819214
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 https://github.com/Raruto/leaflet-elevation/blob/e0c68cba9a71d140e4c5a4179c51ae34588b7327/src/handlers/labels.js#L11 to
and the effect did not occur anymore. Not even with multiple charts with different rotations on the same page.