Chore/refactor gmaps controller js

This commit completes the refactor of the map controller javascript.