public IActionResult UpdateMap( [FromQuery] string dataSetNames, [FromQuery] Period period, [FromQuery] string jsonMapViewModel) { MapViewModel mapViewModel = JsonConvert.DeserializeObject <MapViewModel>(jsonMapViewModel); DateTime to = DateTime.UtcNow; DateTime from; switch (period) { case Period.Week: from = to.AddDays(-7).Date; break; case Period.Month: from = to.AddMonths(-1).Date; break; case Period.Year: default: from = to.AddYears(-1).Date; break; } string time = $"{from.ToString("yyyy-MM-dd")}/{to.ToString("yyyy-MM-dd")}"; Dictionary <string, string> customParameters = new Dictionary <string, string> { { "TIME", time } }; mapViewModel.Services.Clear(); if (dataSetNames != null) { foreach (string name in dataSetNames.Split(',')) { mapViewModel.AddService(_ServiceType, _url, _dataSetToLayerMap[name], customParameters); } } string sld = _transactionDataService.GetAdministrativeUnitSld(); customParameters = new Dictionary <string, string> { { "SLD_BODY", sld } }; mapViewModel.AddService(_ServiceType, _urlAdminUnits, _CountyAdminUnitLayer, customParameters); mapViewModel.AddService(_ServiceType, _urlAdminUnits, _MunicipalityAdminUnitLayer, customParameters); return(PartialView("Views/Common/Map.cshtml", mapViewModel)); }