mapviewer / mapmath: fix mode switching