ThinkGeo.com    |     Documentation    |     Premium Support

CurrentScale problem

Hello


 


I am setting the MapUnit to Meter, and the MinimumScale to 1, the MaximumScale to 2000000,


but the current scale is changing to 0.0012... each time i build the project, so an error occurs when running the project because the currentscale must be between the minimum scale and the maximumscale, even i set the curretscale to 200, it will change on the next build or opening the container form


 


Note: Why when an error occurs in any place in the mapsuite the exception will throw in no place, Can i catch the mapsuite exception in one place like an event handler????


 


thanks



Krypton, 
  
 Thanks for your post. 
  
 I am a bit confused with your description; the current scale should not be excepted to be between MinmumScale and MaximumScale. 
  
 Which version are you using now? You can get the version information by calling API WinformMap.GetVersion(). 
  
 Did you change the ZoomLevelSnappingMode? 
  
 Are you using the Multi-threaded mode or single threaded mode? 
  
 It would be very nice and helpful if you could send me a small sample application to show your problem. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


Ok 



I will send it for you.


 


Why when an error occurs in any place in the mapsuite the exception will  throw in no place, Can i catch the mapsuite exception in one place like  an event handler????



Krypton, 
  
 I am sorry that I missed one of your questions. 
  
 The MapSuite component is a large developing targeted GIS framework, based on which we could develop quite a few applications. In MapSuite component, we rarely eat the exception internally, we just throw it out and let user catch it and decided how to deal with it then. 
  
 One exception here is that we provide a property in Overlay called DrawExceptionMode to control whether the exception need to be thrown out or not. 
  
 Let me know if any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale  


my idea is to make a global error handler in the WinFormsMap control 
 Like the one used in System.Windows.Forms.DataGridView OnError event; it is very powerfull 
  
 because in your control, some errors are occuring in a non-TryCatch block, they could not be catched !!! 
  
 thanks for your interest 


Krypton, 
  
 Thanks for your reply. As my understanding, the MapSuite Map Control is a middleware development control, so absolutely we need to throw the exceptions out directly instead of eat them internally.  
  
 I think there might be a more decent exception mechanism just like do in OnError event in DataGridView, while this logic may be able to be only applied to Control it, because we have another product ServiceEdition in which will use the Layer, Canvas ect classes directly. In this way, I am afraid we cannot control all the exceptions in the whole product in one place. 
  
 Thanks for your suggestions, we will consider it more carefully. 
  
 Let me know if any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale