@@ -307,14 +307,14 @@ private void OnInfo(MapInfoEventArgs mapInfoEventArgs)
307307 Info ? . Invoke ( this , mapInfoEventArgs ) ;
308308 }
309309
310- private void WidgetTouched ( IWidget widget , Point screenPosition )
310+ private bool WidgetTouched ( IWidget widget , Point screenPosition )
311311 {
312312 if ( widget is Hyperlink hyperlink )
313313 {
314314 OpenBrowser ( hyperlink . Url ) ;
315315 }
316316
317- widget . HandleWidgetTouched ( Navigator , screenPosition ) ;
317+ return widget . HandleWidgetTouched ( Navigator , screenPosition ) ;
318318 }
319319
320320 /// <inheritdoc />
@@ -345,7 +345,7 @@ public MapInfo GetMapInfo(IEnumerable<ILayer> layers, Point screenPosition, int
345345 /// <returns>True, if something done </returns>
346346 private static MapInfoEventArgs InvokeInfo ( IEnumerable < ILayer > layers , IEnumerable < IWidget > widgets ,
347347 IReadOnlyViewport viewport , Point screenPosition , Point startScreenPosition , ISymbolCache symbolCache ,
348- Action < IWidget , Point > widgetCallback , int numTaps )
348+ Func < IWidget , Point , bool > widgetCallback , int numTaps )
349349 {
350350 var layerWidgets = layers . Select ( l => l . Attribution ) . Where ( a => a != null ) ;
351351 var allWidgets = layerWidgets . Concat ( widgets ) . ToList ( ) ; // Concat layer widgets and map widgets.
@@ -358,8 +358,15 @@ private static MapInfoEventArgs InvokeInfo(IEnumerable<ILayer> layers, IEnumerab
358358 // How should widgetCallback have a handled type thing?
359359 // Widgets should be iterated through rather than getting a single widget,
360360 // based on Z index and then called until handled = true; Ordered By highest Z
361- widgetCallback ( widget , screenPosition ) ;
362- return null ;
361+ var result = widgetCallback ( widget , screenPosition ) ;
362+
363+ if ( result )
364+ {
365+ return new MapInfoEventArgs
366+ {
367+ Handled = true
368+ } ;
369+ }
363370 }
364371
365372 var mapInfo = MapInfoHelper . GetMapInfo ( layers , viewport , screenPosition , symbolCache ) ;
0 commit comments