Major refactor in order to differentiate the support for Java and
Javascript to the map component.