If I put an element on top of my MapView it shows just fine. However, any Click events are not recorded and are seemingly sent to the MapView instead. This is what I have:
Its hard to tell what’s wrong without a more complete test case. A common problem is that elements are transparent. Try adding a HitTestMode="LocalBounds".
Sorry for prividing an incomplete version. Please find a complete one below. When I click on the white rectangle with the map under it, nothing happens. If I comment out the -bit, it logs “Clicked” as it should. The MapView somehow “steals” the click event from my rectangle. HitTestMode did not work, unfortuantely.
Hi there!
In the case of MapView the above should work on iOS, whereas Androids mapview for some reason is more greedy and steals all our clicks.
I’m not sure what the case is for WebView on Android vs. iOS though.
We’ll look into fixing this properly in the future but in the meantime, here’s a workaround
The trick here is that the Android native button still gets priority on top of the MapView, even if stuff like native rectangles and circles don’t.
So we simply do an invisible button and fill it with our custom visuals.
It’s a bit hackish now but hopefully an acceptable workaround. It’s of course possible to use this to build a slightly more structured custom button class.
I also came across this bug. After several hours of investigation I found the solution in this post.
I performed the workaround and it works but I wanted to know if there were any news about it.
The thing that I recommend doing is to report the bug on the documentation of the mapView otherwise you lose unnecessary hours to figure out what’s wrong.
We have the same issue too. We have a Map and a GraphicsView inside NativeViewHost (on top of the map). And graphics view do not receive tap/click events. We have to wrap everything in buttons. Not clean.