Consuming REST based Cached image services - inconsistent zooming into AOI.

708
3
02-13-2012 07:00 AM
Ravichandran_M_Kaushika
Occasional Contributor
dear Readers,

good morning.  we are implementing a national solution to monitor wetland easement areas of interest.  the application would let the users select state, county, and the contract area of interest from 3 drop downs boxes.  when the user selects the state, using a general layer, the application zooms to the extent of the selected state. Same happens when the users select county and contract areas of interest.  The contract areas are usually of few hundred acres size and when the application zooms to the extent of few hundred acres, the imagery cached layers from a arcmap rest based service are loaded into the map document.  all these zoom and selection of drop down info happens asynchronously in the applcation.

Few observations that ARE causes for concern:

1. when the application is zooming into the 1st contract area of interest, the application stops half way between the county and contract area extent and is usually at the scale of displaying 10s of thousands of acres - since there is a scale dependency for showing imagery layers, the selected contract areas are highlighted (occupies less than 5% of the screen extent) and imagery is not turned on.  when the user SELECTS another contract area in the same county, it zooms to the right extent and displays the imagery.  when the user goes back to the 1st contract area select, it zooms into the contract area completely and displays the imager correctly. it consistently happens for each new county.

The code for zooming into area of interest is used for ESRI's sample site - gettng the extent of teh selected feature - adding a buffer and zoom ing into the buffered extent.

2. when the zoom is happening all the times explained below, the application gets SQL server spatial data into the grid using WCF and draws appropriate graphics (usually less than 10 - rarely more than 25) on the screen.

3.as explained in bullet 1, the retrieval of data happens in less than 5 seconds and appears 'instantaneous' to the user. 

4. Sometimes, the cached imagery redraw from the server is slower than the selected graphic zoom and when the cached imagery is drawn, the application zooms out (altho there is no code to zoom for ANY imagery extent) to display imagery for a larger extent.  the users feel a bounce of 'zoom' happening in front of the eyes.  as i am typing this statement, i went back to see whether there was any code set for .Zoom for the imagery load and i did not find any.

5. When the users change from 1 county to another, the behavior can be repeated for the1st contract area.

6. after a few selections of the contract areas, the cachced imagery service stops drawing on the selection of new contract areas.

we never had this issue when we used dynamic service based imagery bouncing extents. But to be fair, i should say that once the users get the draw/zoom of the contract area correctly panning around the contract areas with cached imagery is a lot smoother and faster than using dynamic imagery service.

to minimize confusion to the application due to the returns from async calls, all calls to do any unit of work (zoom to contract area, load imagery for curr extent, loading data grid, and drawing imagery)  are made in the *_CompletedTask section of the previous task.  inspite of every precaution, the application behaves as indicated above.

any ideas would be of great help.

regards
ravi.
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
Might be an effect of the snap to levels olption. Try by setting SnapToLevels to false.

If still not working, could you share a code sample highlighting the issue?

Thanks
0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor
Dbroux,

good morning.  thanks a lot for your reply. i had opened an esri incident (ending with *9075) and the service representative told me yesterday to try using myMap.Extent = newExtent instead of myMap.ZoomTo(newExtent).

that fixed my problem for now - of course, i would not give that animated fly by zoom effect.

i did not know about that .SnapToLevel flag in the map document.

thanks for your help.

regards
ravi.
0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor
Problem solved. I do not know how to set this Question as ANSWERED.
0 Kudos