Select to view content in your preferred language

calling Map.ZoomTo() and then Map.PanTo() can cause IE to hang, 100% CPU

1074
3
03-11-2011 12:14 PM
AndySanford
Emerging Contributor
calling Map.ZoomTo() and then Map.PanTo() can cause IE to hang, 100% CPU

Using API v2.1 with Silverlight 4, if you:

1) add mappoint p1 to map, then Map.ZoomTo(layer.FullExtent) then Map.PanTo(p1)
2) add mappoint p2 to map, then Map.ZoomTo(layer.FullExtent) then Map.PanTo(p2)

CPU can go to 100% and IE hangs.

The positions of the points seem to matter to get this to repro.

I've attached a repro
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Thank you for sharing with us your sample. I was able to reproduce using your code.
0 Kudos
dotMorten_esri
Esri Notable Contributor
We have identified the issue. However, what I think you are trying to do wouldn't have worked anyway.
When you call one navigation right after the other, the first one will never have a chance to even run (unless you disable zoom and pan animation by setting the duration to 0).
Instead to zoom and center on a point, create an envelope around that point and simply zoom to that (ie no panning).

Ex. zoom to a point with 10 map units space around each side of the point:
myMap.ZoomTo(new Envelope(p.X-10, p.Y-1,p.X+10,p.Y+10));
0 Kudos
AndySanford
Emerging Contributor
We have identified the issue. However, what I think you are trying to do wouldn't have worked anyway.
When you call one navigation right after the other, the first one will never have a chance to even run (unless you disable zoom and pan animation by setting the duration to 0).
Instead to zoom and center on a point, create an envelope around that point and simply zoom to that (ie no panning).

Ex. zoom to a point with 10 map units space around each side of the point:
myMap.ZoomTo(new Envelope(p.X-10, p.Y-1,p.X+10,p.Y+10));


Hi,

Thanks for your response.  I'm very happy that you have found the problem.  Will this be fixed in 2.2? 

Also, I have two questions regarding your response:

1) your response says that in the above scenario, the first request will never get a chance to run.  That is distinct from the behavior I saw in this post:
http://forums.arcgis.com/threads/22285-multiple-calls-to-Map.ZoomTo(Envelope)-doesn-t-always-seem-to...
-So what will be the behavior going forward? 

2) I think it makes sense that if you request two async zoomTo() actions, either they each get executed in the order requested (my preference), OR the last one is the only one to execute (in this case, perhaps the last one cancels any prior ones.)  However, I'm not sure it makes sense that different aync actions should cancel/override each other.  For example, if I first issue ZoomTo() and then issue PanTo(), I don't see why only the PanTo() should occur.  I think the most logical thing is to process them in the order received, at least when the operations are distinct like this.

Thank you so much!

Regards,
-Andy
0 Kudos