reorganize js codes & add a map page and controller to test