ThinkGeo.com    |     Documentation    |     Premium Support

InvalidOperationException The projection is not open

Hi


 I have DesktopEditionFull3.0.184 Beta 2 - could not download  edition 199.


I saw the same problem posted under the web edition: 


  gis.thinkgeo.com/Support/Dis...fault.aspx


 gis.thinkgeo.com/Support/Dis...fault.aspx


I cannot trap the error, I get it on an End Sub when I step through the code.  When I copy the same code to another procedure, it works fine. What is the solution for the Desktop edition?


regards, Alta


System.InvalidOperationException was unhandled

  Message="The projection is not open.  Please open it before calling this method."

  Source="MapSuiteCore"

  StackTrace:

       at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xed94929c048fbff7(Boolean x40fc51452dedaf8a)

       at ThinkGeo.MapSuite.Core.Projection.ConvertToInternalProjection(RectangleShape rectangleShape)

       at ThinkGeo.MapSuite.Core.FeatureSource.ConvertToInternalProjection(RectangleShape rectangle)

       at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesInsideBoundingBox(RectangleShape boundingBox, IEnumerable`1 returningColumnNames)

       at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)

       at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)

       at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)

       at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.xa6cb874f7090c07f(GeoCanvas x31c084515ae9393f)

       at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)

       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.runTryCode(Object userData)

       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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)

 



Alta, 


I strongly recommend you to upgrade your desktop edition to the latest version (3.0.199). We added the multi-threading support in 3.0.184 which led to many cross-threading issues. We turned it off in 3.0.199 by default and it’s much stable now. Sorry for the inconvenience but please make your component up to date first. Here is a post for example you can see the 3.0.184 causes too many issues.
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5153/afv/topic/Default.aspx
 
I think your app will work fine with the latest version. If you still have that problem, could you provide some of your codes to us?
 
Also please ask your sale representative why you couldn’t get the latest version; they will help you with that.
 
Thanks,
 
Ben

I found out what the problem was - the rotationProjection was not always set or open, added the test: If rotationProjection.IsOpen 
  
 Ben, I have 3.0.199 now and it seems to me that when I zoom in or out by using the mouse wheel, the map does not render as nicely as in 3.0.184. It is not really an issue for me.  When I zoom in code, it is correct 
 Thanks

Alta,  
  
 That’s just because we didn’t turn on the MultiThreading in the 3.0.199 version. It might not so great when panning as 3.0.184 but it’s much more stable. We are now still working on the multi threading stuff and hopeful next version we will add it back again. 
  
 Ben 


Ben,


I am encountering a problem much like Alta!


I am adding a point to a map that is using the World Map Kit. I would like to have information returned about that point by clicking on it. When I perform a MapClick to get this information I get: "The projection is not open. Please open it before calling this method."


I have included my sample application and I am using the 3.0.199.0 Version.



Steve, 
  
 In the Map_MapClick event, FL.Close() does not only close the FL layer itself, but also close the projection object shared by all the layers. You can work it around by commenting out layer.Close(). The code should be like this.  
 
      If Not FL.IsOpen Then
            FL.Open()
        End If
        SelFeatures = FL.QueryTools.GetFeaturesNearestTo(e.WorldLocation, GeographyUnit.DecimalDegree, 1, New String(0) {""})
        'FL.Close()
 
 I removed your attached sample which includes the WorldMapKitRenderers.vb file, that’s specific for World Map Kit and not supposed to be shared. Please do not include that file when share your codes. 
  
 Thanks, 
  
 Ben