Reputation: 1307
I followed this article to create a custom MapRenderer
for iOS in my Xamarin.Forms PCL project, which in itself works fine. However, I'm desperately looking for a way to react on tap/click events on a Pin
's callout (i.e. the info flag that pops up when you tap on a Pin
itself). I know that there's a OnCalloutAccessoryControlTapped
on the iOS level, but is there a way to react on callout-taps/clicks on PCL level? Only thing I could find is the Pin.Clicked
event.
pin.Clicked += async(sender, e) => {
await DisplayAlert("Test", "Test", "test");
};
Is there a similar event for the callout (don't know what it's called on Android, sorry), which opens up when you click on a pin?
Upvotes: 0
Views: 474
Reputation: 1307
Ok, for everybody reading this having the same idea/problem:
The event Pin.Clicked
will be fired whenever the user clicks on the Pin
's label and NOT on the Pin
itself!
Upvotes: 0
Reputation: 14956
in Android ,CustomMapRenderer
class implements the GoogleMap.IInfoWindowAdapter
interface which have GetInfoWindow
and GetInfoContents
methods to customize the info window ,and there is an event OnInfoWindowClick
, when the user clicks on the info window,this method opens a web browser and navigates to the address stored in the Url
property of the retrieved CustomPin
instance for the Marker
.
you could refer to :Custom Map Pin on Android
Upvotes: 0