Refactor gmap view code into simple object.