Bug 25689 - Xamarin.Forms.Maps relies on old version of Xamarin.GooglePlayServices
Summary: Xamarin.Forms.Maps relies on old version of Xamarin.GooglePlayServices
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-03 03:27 UTC by Vladislav Kosev
Modified: 2015-01-16 22:07 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description Vladislav Kosev 2015-01-03 03:27:39 UTC
In Xamarin.GooglePlayServices 16 there is a class Android.Gms.Maps.GoogleMap+InfoWindowClickEventArgs which has a property "P0" representing the clicked marker. In Xamarin.GooglePlayServices 19 this property is (more appropriately) renamed "Marker". Xamarin.Forms.Maps.Android.MapRenderer has this method, which clearly was not compiled with 19 in mind (from .NET Reflector, hence the get_ calls):

private void MapOnMarkerClick(object sender, GoogleMap.InfoWindowClickEventArgs eventArgs)
{
    Marker marker = eventArgs.get_P0();
    Pin pin = null;
    for (int i = 0; i < this.Map.get_Pins().Count; i++)
    {
        Pin pin2 = this.Map.get_Pins()[i];
        if (!(((string) pin2.Id) != marker.Id))
        {
            pin = pin2;
            break;
        }
    }
    if (pin != null)
    {
        pin.SendTap();
    }
}

This throws an exception when a marker is clicked. The problem is that a custom renderer inheriting this one cannot stop this from happening, so there is no working around it if you want to use Xamarin.GooglePlayServices 19 and higher.
Comment 1 Jason Smith [MSFT] 2015-01-16 22:07:00 UTC
Updated in Xamarin.Forms 1.3.2-pre1