@@ -228,15 +228,26 @@ private async Task<GisFeatures> FetchGisFeatures(double lat, double lng)
228228
229229 await Task . WhenAll ( tasks . Values ) ;
230230
231- bool anyLayerResponded = tasks . Values . Any ( t => t . Result >= 0 ) ;
231+ // Await each completed task to surface results without resorting
232+ // to .Result (matches the pattern used in GeoController.cs).
233+ int construction = await tasks [ "construction" ] ;
234+ int permits = await tasks [ "permits" ] ;
235+ int nightWork1 = await tasks [ "nightWork1" ] ;
236+ int nightWork2 = await tasks [ "nightWork2" ] ;
237+ int roadWork1 = await tasks [ "roadWork1" ] ;
238+ int roadWork2 = await tasks [ "roadWork2" ] ;
239+ int cityPlans = await tasks [ "cityPlans" ] ;
240+
241+ bool anyLayerResponded = new [ ] { construction , permits , nightWork1 , nightWork2 , roadWork1 , roadWork2 , cityPlans }
242+ . Any ( v => v >= 0 ) ;
232243
233244 var gis = new GisFeatures
234245 {
235- ConstructionSiteCount = Math . Max ( 0 , tasks [ " construction" ] . Result ) ,
236- PermitCount = Math . Max ( 0 , tasks [ " permits" ] . Result ) ,
237- NightWorkCount = Math . Max ( 0 , tasks [ " nightWork1" ] . Result ) + Math . Max ( 0 , tasks [ " nightWork2" ] . Result ) ,
238- RoadWorkCount = Math . Max ( 0 , tasks [ " roadWork1" ] . Result ) + Math . Max ( 0 , tasks [ " roadWork2" ] . Result ) ,
239- CityPlanCount = Math . Max ( 0 , tasks [ " cityPlans" ] . Result ) ,
246+ ConstructionSiteCount = Math . Max ( 0 , construction ) ,
247+ PermitCount = Math . Max ( 0 , permits ) ,
248+ NightWorkCount = Math . Max ( 0 , nightWork1 ) + Math . Max ( 0 , nightWork2 ) ,
249+ RoadWorkCount = Math . Max ( 0 , roadWork1 ) + Math . Max ( 0 , roadWork2 ) ,
250+ CityPlanCount = Math . Max ( 0 , cityPlans ) ,
240251 HasGisData = anyLayerResponded ,
241252 } ;
242253
0 commit comments