working legend, tileLayer and featureLayer