I can see this logic growing larger if there are more options added to Marker. There for this if section for creating @gMarker should become a separate function.