There are now two separate lrmControl.on('routeselected', ...) listeners registered back-to-back. This makes it easy for the handlers to diverge and doubles event dispatch work. Consider merging the route-export logic and the fit/pan logic into a single routeselected handler (or extracting shared pieces into a helper) to keep the event flow easier to reason about.
There are now two separate lrmControl.on('routeselected', ...) listeners registered back-to-back. This makes it easy for the handlers to diverge and doubles event dispatch work. Consider merging the route-export logic and the fit/pan logic into a single routeselected handler (or extracting shared pieces into a helper) to keep the event flow easier to reason about.