fix #339. Improved build in when map rotated.