Xamarin.forms.googlemaps: Close / Disable Info Window

Created on 25 May 2017  路  3Comments  路  Source: amay077/Xamarin.Forms.GoogleMaps

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.

PLATFORMS

  • [x] Android
  • [ ] iOS
  • [ ] UWP

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;
};

All 3 comments

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;
};

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hieumoscow picture hieumoscow  路  5Comments

idan-rubin picture idan-rubin  路  6Comments

kitkat14 picture kitkat14  路  3Comments

JKennedy24 picture JKennedy24  路  6Comments

ViktorBylbas picture ViktorBylbas  路  4Comments