Repainting the mapbuffer in separate thread. Code looks hidious, i will do some cleanup later