update share URL when layerPicker checkbox unchecked, as well as when checked
use new addLayerToLegend() function to add shared layer legend items
rewrites addLayerToLegend() more concisely