add support for mapfile auto detect

Signed-off-by: Nigh <jiyucheng007@gmail.com>