merged from mapjs