compaqdrew

CALayerInvalidGeometry crash

Discussion created by compaqdrew on Apr 11, 2011
Latest reply on Apr 11, 2011 by compaqdrew
Whenever I try to do a two-finger zoom on the AGSMapView, I get a CALayerInvalidGeometry exception.  (iPad Simulator 4.3.)  What am I missing?

Here's my code:


GSMapView *test = [[[AGSMapView alloc] init] autorelease];
    NSString *bingMapsKey=@"<my-bing-maps-key>";
    AGSBingMapLayer *layer = [[[AGSBingMapLayer alloc] initWithAppID:bingMapsKey style:AGSBingMapLayerStyleAerial] autorelease];
    UIView <AGSLayerView> *bingView = [test addMapLayer:layer withName:@"bing"];
    bingView.drawDuringPanning = YES;
    bingView.drawDuringZooming = YES;
    AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:102100];
    AGSEnvelope *env = [AGSEnvelope envelopeWithXmin:-13626513.829723023 ymin:4549088.827634182 xmax:-13626131.64458163 ymax:4549638.218774935 spatialReference:sr];
    [test zoomToEnvelope:env animated:YES];
    
    
    [self.view addSubview:test];
    test.frame = CGRectMake(0, 0, 500, 500);


Here's the exception and stack trace:
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
*** Call stack at first throw:
(
 0   CoreFoundation                      0x014d95a9 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x0162d313 objc_exception_throw + 44
 2   CoreFoundation                      0x01491ef8 +[NSException raise:format:arguments:] + 136
 3   CoreFoundation                      0x01491e6a +[NSException raise:format:] + 58
 4   QuartzCore                          0x00441ba2 _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177
 5   QuartzCore                          0x00441d55 -[CALayer setPosition:] + 42
 6   QuartzCore                          0x0043a24d -[CALayer setFrame:] + 763
 7   app                              0x000af119 -[AGSMapView assignAnchorPointToMapLayersView:] + 754
 8   app                              0x000b432c -[AGSMapView touchesBegan:withEvent:] + 1970
 9   UIKit                               0x00a2e0f4 forwardMethod2 + 92
 10  UIKit                               0x00984d41 -[UIWindow _sendTouchesForEvent:] + 395
 11  UIKit                               0x00965c37 -[UIApplication sendEvent:] + 447
 12  UIKit                               0x0096af2e _UIApplicationHandleEvent + 7576
 13  GraphicsServices                    0x01e78992 PurpleEventCallback + 1550
 14  CoreFoundation                      0x014ba944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
 15  CoreFoundation                      0x0141acf7 __CFRunLoopDoSource1 + 215
 16  CoreFoundation                      0x01417f83 __CFRunLoopRun + 979
 17  CoreFoundation                      0x01417840 CFRunLoopRunSpecific + 208
 18  CoreFoundation                      0x01417761 CFRunLoopRunInMode + 97
 19  GraphicsServices                    0x01e771c4 GSEventRunModal + 217
 20  GraphicsServices                    0x01e77289 GSEventRun + 115
 21  UIKit                               0x0096ec93 UIApplicationMain + 1160
 22  app                              0x000025fe main + 126
 23  app                              0x00002575 start + 53

Outcomes