Bug 35601 - MapBox component overlay creation
Summary: MapBox component overlay creation
Status: RESOLVED FIXED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jon Dick
URL:
Depends on:
Blocks:
 
Reported: 2015-11-05 17:48 UTC by k.a.shah
Modified: 2015-12-01 16:46 UTC (History)
1 user (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 k.a.shah 2015-11-05 17:48:20 UTC
Code:

public class DemographicsOverlay : Overlay
	{
		#region implemented abstract members of Overlay

		public override bool IntersectsOverlayBounds (CoordinateBounds overlayBounds)
		{
			return true;
		}

		#endregion

	}

The crash occurs when I initialize the DemographicsOverlay class.

Stacktrace:
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at <unknown> <0xffffffff>
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at (wrapper managed-to-native) ApiDefinition.Messaging.IntPtr_objc_msgSendSuper (intptr,intptr) <IL 0x0002e, 0xffffffff>
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at Mapbox.Overlay..ctor () <IL 0x00067, 0x00183>
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at MapboxSampleiOS.DemographicsOverlay..ctor () <IL 0x00001, 0x00017>
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at MapBoxSampleiOS.ViewController/<ViewDidLoad>c__async0.MoveNext () [0x001f9] in /Users/khyati/Downloads/mapboxsdk-2.1.2/samples/MapboxSampleiOS/MapboxSampleiOS/ViewController.cs:49
2015-11-05 16:35:53.281 MapboxSampleiOS[3599:918401] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1076
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x00027] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Threading/ExecutionContext.cs:242
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Threading/ExecutionContext.cs:228
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x0003b] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1057
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction (object) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:753
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&) [0x00017] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:784
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task,bool) [0x00016] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:424
2015-11-05 16:35:53.282 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.Task.FinishContinuations () [0x0008c] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3668
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2387
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.Task`1.TrySetResult (TResult) [0x00058] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:488
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult (TResult) [0x0001f] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:568
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at MapBoxSampleiOS.CustomHttpUtility/<SecureGetRequestAsync>c__async1.MoveNext () [0x00109] in /Users/khyati/Downloads/mapboxsdk-2.1.2/samples/MapboxSampleiOS/MapboxSampleiOS/CustomHttpUtility.cs:132
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1076
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x00027] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Threading/ExecutionContext.cs:242
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Threading/ExecutionContext.cs:228
2015-11-05 16:35:53.283 MapboxSampleiOS[3599:918401] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x0003b] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1057
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.<s_postCallback>m__0 (object) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:393
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at UIKit.UIKitSynchronizationContext/<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/UIKit/UIKitSynchronizationContext.cs:24
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/Foundation/NSAction.cs:163
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0005e, 0xffffffff>
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at <unknown> <0xffffffff>
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000ae, 0xffffffff>
2015-11-05 16:35:53.284 MapboxSampleiOS[3599:918401] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/UIKit/UIApplication.cs:77
2015-11-05 16:35:53.285 MapboxSampleiOS[3599:918401] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/UIKit/UIApplication.cs:61
2015-11-05 16:35:53.285 MapboxSampleiOS[3599:918401] critical:   at MapBoxSampleiOS.Application.Main (string[]) [0x00008] in /Users/khyati/Downloads/mapboxsdk-2.1.2/samples/MapboxSampleiOS/MapboxSampleiOS/Main.cs:12
2015-11-05 16:35:53.285 MapboxSampleiOS[3599:918401] critical:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>
2015-11-05 16:35:53.285 MapboxSampleiOS[3599:918401] critical: 
Native stacktrace:
Comment 1 Jon Dick 2015-12-01 16:46:05 UTC
In 3.0.0 the IOverlay interface will be fixed to require the additional properties.  You should then define an overlay like:

    public class DemographicsOverlay : NSObject, IOverlay
    {
        public bool IntersectsOverlayBounds (CoordinateBounds overlayBounds)
        {
            return true;
        }

        public CLLocationCoordinate2D Coordinate {
            get {
                return new CLLocationCoordinate2D (45.522585, -122.685699);
            }
        }
        public CoordinateBounds OverlayBounds {
            get {
                return new CoordinateBounds {
                    NorthEast = new CLLocationCoordinate2D (45.522585, -122.685699),
                    SouthWest = new CLLocationCoordinate2D (45.522585, -122.685699)
                };
            }
        }
    }

You shouldn't see a crash after this in the 3.0.0 that is to be released shortly.