separated out gmap functionality