Zoom and Pan MAP is very slow when used with World Base Map

2664
4
03-11-2014 11:21 AM
Labels (1)
chummaM
New Contributor
Hi,

Am using the following basemap "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" in my WPF application. Whenever I do ZOOM or PAN map the application is very slow. But if I remove the base map it is very faster. I already tried setting up the pan and map duration to 0. But it doesn't help. Can anyone suggest me how to fix this issue.

I have tried using the same base map from ARCGIS DESKTOP and it is faster like anything. So we can eliminate the possibilities like network or firewall issue. This slowness issue occurs only when I use the ZOOM  and PAN with in the WPF application. Please let us know is there anything can be done to fasten it up. The following code is used for ZOOM.

---------------  ZOOM (Zoomfactor used is 2)

                double currentResolution = mapMain.Resolution;
                mapMain.ZoomFactor = this.myZoomFactor;
                // Calculate the ZoomIn Ratio. It is the inverse of the ZoomFactor (ex: 1 / 2 = 0.5).
                double myZoomInRatio = 1 / myZoomFactor;
                // Calculate the ZoomIn Resolution. The current Map.Resolution * ZoomIn Ratio.
                double myZoomInResolution = currentResolution * myZoomInRatio;

                // Use the ZoomToResolution Method to perform the zoom and center. - WORKING SAME AS
                //CenterAndZoom_via_ZoomToResolution(e.MapPoint, myZoomInResolution);

                // Use the ZoomTo Methdod to perform the zoom and center.
                CenterAndZoom_via_ZoomTo(e.MapPoint, myZoomInResolution);
--------------

   private void CenterAndZoom_via_ZoomTo(ESRI.ArcGIS.Client.Geometry.MapPoint myMapPoint, double myResolution)
        {
            try
            {
                // Calculate the bounding extents of the zoom centered on the users point click on the Map.
                double xMin = myMapPoint.X - (mapMain.ActualWidth * myResolution * 0.5);
                double yMin = myMapPoint.Y - (mapMain.ActualHeight * myResolution * 0.5);
                double xMax = myMapPoint.X + (mapMain.ActualWidth * myResolution * 0.5);
                double yMax = myMapPoint.Y + (mapMain.ActualHeight * myResolution * 0.5);

                // Construct an Envelope from the bounding extents.
                ESRI.ArcGIS.Client.Geometry.Envelope myEnvelope = new ESRI.ArcGIS.Client.Geometry.Envelope(xMin, yMin, xMax, yMax);

                // Adjust the Map.Extent using the ZoomTo Method. It will be centered where the user clicked.
                mapMain.ZoomTo(myEnvelope);
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

Regards
Nedu. M
0 Kudos
4 Replies
DavidLednik
Occasional Contributor II
Hi,

Does the click code execute only once when you click the map point where you wan't the zoom to happen?

Regards,
David
0 Kudos
chummaM
New Contributor
Hi,

Does the click code execute only once when you click the map point where you wan't the zoom to happen?

Regards,
David


Thanks David.

Yes, you are right. The click code executes only once.

Regards
Chumma
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Are you running with a debugger attached? If so, try running the app without a debugger. It's a known issue:

Navigation can appear slow when a debugger is attached and the map has the accelerated display mode enabled. The display can appear to "stutter" when zooming in, especially on tile layers. This is due to performance impact of the debugger interacting with .Net exception handling. The exceptions are within the.Net framework and are caused by cancelling in-progress web requests for tiles that are not needed for display. It is recommended to verify application performance in release mode without a debugger attached.

Cheers

Mike
0 Kudos
chummaM
New Contributor
Hi,

Are you running with a debugger attached? If so, try running the app without a debugger. It's a known issue:

Navigation can appear slow when a debugger is attached and the map has the accelerated display mode enabled. The display can appear to "stutter" when zooming in, especially on tile layers. This is due to performance impact of the debugger interacting with .Net exception handling. The exceptions are within the.Net framework and are caused by cancelling in-progress web requests for tiles that are not needed for display. It is recommended to verify application performance in release mode without a debugger attached.

Cheers

Mike


Thanks for helping Mike.

I have verified the code and it is release mode and not attached with debugger.

Could you please think of any other reason for this slowness?

Regards
Chumma
0 Kudos