To install the map2djs package, you can choose to either install from source, or from the Ubuntu package:
Source
To install from source, execute the following:
git clone https://github.com/RobotWebTools/map2djs.git -b groovy-devel
Ubuntu Package
To install the Ubuntu package, execute the following:
sudo apt-get install ros-groovy-map2djs
Afterwards, you can find where the files were installed by executing the following:
roscd map2djs