added the view model for MapLegend functionality