Bug 15000 - MKPolyline.BoundingMapRect returns <0,0>/<Infinity,Infinity>
Summary: MKPolyline.BoundingMapRect returns <0,0>/<Infinity,Infinity>
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.0.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-09-25 19:37 UTC by Darrel
Modified: 2013-09-26 11:46 UTC (History)
2 users (show)

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:

Description Darrel 2013-09-25 19:37:18 UTC
Sample code:

CLLocationCoordinate2D[] corrds = new CLLocationCoordinate2D[] {
  new CLLocationCoordinate2D(47.0, -121.0),
  new CLLocationCoordinate2D(47.1, -121.1)
MKPolyline pl = MKPolyline.FromCoordinates(coords);
MKMapRect rect = pl.BoundingMapRect;
Console.Out.WriteLine("" + rect.InNull);

In fact, the bounding box of "pl" is <0,0>/<Infinity,Infinity>. When inspected in debugger, "rect" returns "incorrect number or types of arguments".

This worked fine in previous version of Xamarin.iOS.
Comment 1 Darrel 2013-09-25 19:40:17 UTC
Hey my first bug and it's #15000... What's my prize? =)
Comment 2 Rolf Bjarne Kvinge [MSFT] 2013-09-26 06:50:45 UTC
Heh, no prize for bug #15000 :) We will give you something if you fix 15000 bugs though...

Anyways, I tried your test code (with a few minor fixes to make it compile), and it prints False for me.

If I print out the rect:

Console.WriteLine (rect);

I get this:

{{43919023.2177778, 94306352.957357}, {74565.4044444412, 109436.200460866}}

is this the expected behavior?
Comment 3 Darrel 2013-09-26 11:08:24 UTC
Actually you are absolutely right. The BoundingMapRect works as expected, but somehow when it is added to a MKMapView as an overlay, it's not visible even though the overlay appears to be in the list.
Comment 4 Darrel 2013-09-26 11:46:57 UTC
A bit more search shows that this might be related to a change in iOS7. I'll do some experiment. Meanwhile I'll close this bug, and sorry for the trouble.