>                 [MonoPInvokeCallback (typeof (DrawLayerDelegate))]
>                 static void DrawLayer (IntPtr @this, IntPtr selector,
> CALayer layer,
> CGContext context)
>                 {
>                         // do nothing
>                 }
>

You can not marshal reverse callbacks with a CALayer as a parameter like
that.

Replace the above with:
static void DrawLayer (IntPtr @this, IntPtr selector, IntPtr _layer,
IntPtr _context)
{
    var layer = Runtime.GetNSObject (_layer) as CALayer;
    using (var context = new CGContext (_context)){
       // Your code goes here.
    }
}

                static DrawLayerDelegate DrawLayerImplementation =
> DrawLayer;
>
>                 private void DisableBaseMap (UIView mapView)
>                 {
>                         // -- get rendering layer
>                         UIView rootView = mapView.Subviews[0];
>                         UIView vkmapView = rootView.Subviews[0];
>                         UIView vkmapCanvas = vkmapView.Subviews[0];
>
>                         IntPtr canvas_class = new Class
> (vkmapCanvas.GetType ()).Handle;
>                         IntPtr method = class_getInstanceMethod
> (canvas_class, new Selector
> ("drawLayer:inContext:").Handle);
>                         IntPtr new_impl =
> Marshal.GetFunctionPointerForDelegate(DrawLayerImplementation);
>
>                         method_setImplementation (method, new_impl);
>                 }
>
>
>
> It builds, runs, but then get this:
>
>     *System.Runtime.InteropServices.MarshalDirectiveException* has been
> thrown
> The type `MonoTouch.CoreAnimation.CALayer' layout needs to be Sequential or
> Explicit
>
> and at the top of the stack trace:
>
>     System.Runtime.InteropServices.MarshalDirectiveException: The type
> `MonoTouch.CoreAnimation.CALayer' layout needs to be Sequential or Explicit
>   at (wrapper native-to-managed)
> CgMobilePOC3.UI.Touch.Views.MainMapView:DrawLayer
>
> (intptr,intptr,MonoTouch.CoreAnimation.CALayer,MonoTouch.CoreGraphics.CGContext)
>
> Any ideas what might be missing/wrong?
>
> Thanks!
>
> Dennis
>
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Disable-mapkit-basemap-tp4657590.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to