implement map saving possibility while MapViewer closing

Signed-off-by: anti-freak <antifreak2011@gmail.com>