Map Extent changes - Stack over flow exception

539
2
04-29-2013 12:21 PM
LakshmananVenkatesan
Occasional Contributor II
In our sliverlight application for many work flows we are changing map extents. Below method has been called multiple times , application throws stack over flow exception. We could not find reason for this issue, Can any one provide me best way to handle this issue ? Please help this is urgent production issue


public void SetMapExtent(Envelope envelope)
        {
            if (envelope.SpatialReference == null)
                envelope.SpatialReference = mapSection.SpatialReference;
            mapSection.Extent = envelope;
        }
0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor
The best thing to do is set a breakpoint on this method, then let it hit it a few times. Next look at your call stack window and see what's causing this cyclic behavior. One example could be you're listening to ExtentChanged, which in certain conditions might call back to this method, and then you get yourself an infinite loop.
0 Kudos
Sravan_KumarUddarraju
New Contributor
I am having the same issue. I am trying to restrict the extent of the map. I have created the behavior for this, but MapExtent changed event is going to infinity loop. I am using Silverlight Viewer API 3.2. Please see the attached screenshot

How to resolve this issue without going to infinity loop.


Thanks,
Sravan
0 Kudos