Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
[Originally posted in the Xamarin forums: http://forums.xamarin.com/discussion/comment/168811]
I'm using the just-released 3.0.0 version of the Mapbox SDK component published by Xamarin. It looks pretty good so far, but I'm running into a strange problem with markers.
The MarkerClick event is only raised on the first tap or click of a given marker.
After that, the delegate never gets called again no matter how many times I tap or click the marker. If I remove the unclickable marker and add a new one in its place, the event will be raised again on the first tap or click for the new marker, but then it will stop working again. This also occurs if I call SetOnMarkerClickListener() directly instead of using the MarkerClick event. My implementation of IOnMarkerClickListener will get called on the first tap or click, but after that, nothing.
After looking at the Xamarin code in Assembly Browser and the native Mapbox GL code on github (see link below), it looks like the selectMarker method in the underlying MapView class automatically "selects" a marker when it has been tapped or clicked, regardless of whether the event handler says the event was "handled" or not. The MarkerClick event is no longer raised for that marker while it is deselected.
Unfortunately, though, the Xamarin wrapper for the MapView does not expose the underlying DeselectMarker/Markers methods, so I don't see any way to programmatically re-enable click events without waiting for the user to click elsewhere on the map. Based on the latest underlying code, this should automatically deselect any selected markers, and once that happens, the MarkerClick event should start working again. However, I'm not seeing this behavior (still no click events even after clicking off from the marker), so if I just want to handle click events and not get the default behavior of showing (and later dismissing) an info window, I don't see a workaround.
Mapbox GL links:
I'm not seeing this behaviour in the latest version of the bindings and component (v220.127.116.11). Could you please give it another try?