Modularize JavaScript Code

Yes, probably just stick to this :slight_smile:

Your work seems to be in the correct direction (pun intended ;)) and I highly appreciate this! I once started the UI as a very simplistic demo without thinking for future maintenance and now it is time to throw it away or refactor it. In case you think the first option is better - let me know. Also I forgot to tell you about the work done here: GitHub - Kasheftin/graphhopper-frontend Kasheftin did also a bit modernization of the UI itself with knockoutjs and implemented the “dragging from a line” seen in other popular online route planners already. But I never found time to include these features or our other features there so it got sadly in a stale state. Try it here: GraphHopper frontend

As I remember from some of my previous ‘investigations’: the npm packaging and require will at the end also enable us to minify the code too, and use one js for production although we use several JS files for development - is this correct?

As we have also a very tiny test coverage in the demo, feel free to add stuff there too, if the refactoring breaks code without notifying us in these tests.