Implement magicLine for navigation (navigation.js)