added internal function to collect legend information from urfunction