Api 3.2: Value does not fall within the expected range error in a tabcontrol

3539
3
04-22-2014 02:27 AM
GeneticsGenetics
New Contributor
When zooming the map to a different location from code while the map itself is not visible on screen because another tab in a tabcontrol is active, the following error occurs:

System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at ESRI.ArcGIS.Client.Map.getFullViewExtent()
   at ESRI.ArcGIS.Client.Map.loadContinuousZoomLayersInView(Boolean useTransitions)
   at ESRI.ArcGIS.Client.Map.setOriginAndResolution(Double currentResolution, MapPoint currentOrigin, Boolean resetTransforms, Boolean skipLayers)
   at ESRI.ArcGIS.Client.Map.beginZoomToExtent(Envelope targetExtent, Boolean skipAnimation)
   at ESRI.ArcGIS.Client.Map.zoomTo(Geometry geom, Boolean skipAnimation)
   at ESRI.ArcGIS.Client.Map.ZoomTo(Geometry geom)
   at EsriTestExtendBug.MainPage.Button_Click(Object sender, RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}



The same error occurs when panning the map with the mouse and quickly change tabs before rendering the map is complete.

The error is easily reproducible with the attached project and occurs when clicking the button on the second tab which tries to zoom the map to a geometry. Assigning a new extent to the map produces the same error.

These errors did not occur while using the 3.1 API.
0 Kudos
3 Replies
AsserSwelam1
Occasional Contributor
Hi,

Thank you for telling us about this, the problem is changing the map visualization (change extent, remove or add layer or change spatial reference....) while it is hidden by the the tab control will cause this issues.

Try to avoid changing the map visualization while the map tab is not selected.

I attached some code update for your project with some workarounds to avoid this.

Thanks,
Asser
0 Kudos
SethPatrich
New Contributor III
I'm getting the same error, even when the active tab control is the one containing the map. 

This was a severe enough issue for us that I am downgrading to v3.1.

--Seth
0 Kudos
hanlong
New Contributor

I'm getting the same error,so I change the API to V3.1, Is it a bug  of  V3.2 ?

0 Kudos