Zoom out to a specific Envelope and then Zoom in to a Feature

498
2
Jump to solution
02-25-2013 07:12 AM
EnriqueIbarra
New Contributor III
I'm trying to get this effect but still not getting it, I have a data grid with multiples features, when my app initialize it does a zoom to a specific envelope, I store it and when I select one of the features, the app Zoom in to feature, wath I Want is: when I select a feature from the data grid, zoom out to the stored enevlope and then zoom in the feature selected.
I've tried this:

MapaBase.ZoomDuration = new TimeSpan(0, 0, 3); //I declare the zoom duration to get the effect                 MapaBase.ZoomTo(coberturaDeEstados.Expand(1.1)); //the principal Envelope stored.                 MapaBase.ZoomTo(coberturaDeClientesZoom.Expand(1.2)); //the Feature envelope.


zoom duration is not respected in zoom out (Principal Envelope) or makes it so fast because only can see the zoom to the feature envelope.

some Idea to solve it?
Thanks in advance
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
ZoomTo is an asynchronous method whose duration is managed by the ZoomDuration property.
If you call twice ZoomTo at the same time, the 2 methods won't be executed sequentially which is likely what you would expect.
The way to do it is to subscribe to Map.ExtentChanged event, call ZoomTo, and call again 'ZoomTo' in the extent changed event Handler.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
ZoomTo is an asynchronous method whose duration is managed by the ZoomDuration property.
If you call twice ZoomTo at the same time, the 2 methods won't be executed sequentially which is likely what you would expect.
The way to do it is to subscribe to Map.ExtentChanged event, call ZoomTo, and call again 'ZoomTo' in the extent changed event Handler.
0 Kudos
EnriqueIbarra
New Contributor III
ZoomTo is an asynchronous method whose duration is managed by the ZoomDuration property.
If you call twice ZoomTo at the same time, the 2 methods won't be executed sequentially which is likely what you would expect.
The way to do it is to subscribe to Map.ExtentChanged event, call ZoomTo, and call again 'ZoomTo' in the extent changed event Handler.


Thanks Dominique! it solves my problem.
0 Kudos