ThinkGeo.com    |     Documentation    |     Premium Support

Runtime exceptions after upgrading from beta1 to beta2

Hi,


After upgrading from beta1 to beta2 i am struggling just to get stuff working again... Its becoming frustrating because I keep getting various exceptions and errors trying to do the exact same stuff i just had working previous to the update.  The most current i keep hitting is:


InvalidOperationException: 


 "The GeoCanvas is currently not drawing.  Please call the BeginDraw method before calling this method."


Stack Trace:


   at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xbc32d22242378f5c(Boolean x1c27a8ea53684488)

   at ThinkGeo.MapSuite.Core.GeoCanvas.get_CurrentWorldExtent()

   at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)

   at ThinkGeo.MapSuite.DesktopEdition.xf0380b1a0bc40ca6.StartDraw()

   at ThinkGeo.MapSuite.DesktopEdition.x601a5561df898600.x7510a5c148e0acfd(Object x19b0b2213afc2289)

   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)


Anyone have any thoughts as to what might be causing this exception, I don't believe i'm trying to do anything fancy on the map?


Thanks, Chad



Chad, 
  
   Can you post a little code showing what you are doing?  Can you check to see if this is happening in our samples?  Could you compare a little bit between them and your code.  If you post a simple sample it would be tons easier to help you out.  Sorry about the problems. 
  
 In general this is an exception when you try to call a method on a GeoCanvas before you have called the BeginDraw on it.  If you are not doing anything special you should not see this so it might be a bug. :-( 
  
 David

I got restless and called about this but while putting together a small demo project with the problem i think i narrowed down what is causing the problem.  Basically when stripping everything out and simply adding a ScaleBarAdornmentLayer to the map, I always get this exception. 


//This code left in gives the exception, take it out and problem goes away.



ScaleBarAdornmentLayer


sbar.Name =


sbar.Location =


Map.StaticOverlay.Layers.Add( sbar.Name, sbar );


 sbar = new ScaleBarAdornmentLayer();"adsf";AdornmentLocation.Center;


 



FYI>> Just went into the samples and tried changing the boiler plate

example to use a ScaleBarAdornmentLayer instead of the Line... And am getting the same exception as i was getting in my own project.  Should be easy to reproduce now.



CreateAScaleLineAdornmentLayer



Chad, 
  
  Thank you very much, that narrows it down allot!  I will check to see with the developers if there is a bug in there somewhere.  For now if you could leave it out until I get back with you. 
  
 Please post a response to this message.  It will make sure this thread stays in our work queue so when I have the result I can respond.  This just helps me out, when a thread ends with my response it is take out of the queue. 
  
 David

No problem.  Yeah i went ahead and switched over to the ScaleLineAdornmentLayer for the time being.  Any chance you can get someone to look into my previous post about how to get the FullExtent of a map :-)



Chad, 
  
 We confirmed it is a bug and thanks for reporting. We have committed it to our issue system and we will fix it in the next release.  
  
 Thanks, 
  
 Ben.