Refactor js for base and overlap maps