Hi,
I am having an issue while zooming.
I am attempting to do the following:
I have various features that intersect. I need find a particular intersection point and zoom to the minumum scale with that point in the center of the map. Finding the point works fine but zooming randomly crashes.
Here is my code:
WinformsMap1.CenterAt(SelectedintersectionFeature.IntersectionPoint.Points(0))
WinformsMap1.CurrentScale = WinformsMap1.MinimumScale
WinformsMap1.Refresh()
This works most of the time but sometimes randomly this crashes with an InvalidOperationException. I havent been able to recreate this consistently even for the same exact point I want to zoom to. I have also tried zoomtoscale method which also randomly crashes.
The full error below:
System.InvalidOperationException was unhandled
Message="The Layer must be opened before you can perform this method."
Source="MapSuiteCore"
StackTrace:
at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.x0ec28dd371779fa5(Boolean x40fc51452dedaf8a)
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.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5e1f8125aa040824(Object x2680f14bfcc5c488)
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)
InnerException:
Can someone please help me with this.
Thank you
Madduri