Close / Disable Info Window
I need the ability to just disable info window so it does not popup - I can get this working on iOS by just setting the selected pin again but this does not work for Android.
Could you try below code?
This is disable Pin selecting.
map.PinClicked += (sender, e) =>
{
e.Handled = !map.IsEnabled;
};
Hi Amay,
I've tried and it still ignores anything I place in the brackets:
myMap.PinClicked += (sender, e) =>
{
DisplayAlert("Test","test","ok"); //display does show up, also tested without display
e.Handled = !myMap.IsEnabled; // pin info window popup still appears
};
Is there any way in a custom renderer I can disable this?
I have tried this (in my customer renderer .cs)
public void HandleMarkerClick(object sender, GoogleMap.MarkerClickEventArgs e)
{
e.Handled = true;
}
If I set e.Handled to true the info window does not show up but then I can't pass any data on when a pin is clicked, e.g pass position from marker clicked.
Is this the only way to disable the info window ?
I have tried "e.Marker.HideInfoWindow(); " instead of setting handled = true, but that does nothing.
Hi , you can use code for disable Info Window
myMap.PinClicked += (sender, e) =>
{
e.Pin.Label = null;
e.Pin.Address = null;
myMap.SelectedPin = null;
};
Most helpful comment
Hi , you can use code for disable Info Window
myMap.PinClicked += (sender, e) =>
{
e.Pin.Label = null;
e.Pin.Address = null;
myMap.SelectedPin = null;
};