Improvements to map edge line drawing

The problem turns out to be considerably more complex...