In my current project I'm updating my app's GPS system from ArcGIS runtime 10.2 to 100.7. From testing, everything seems to work but the zooming is not smooth whatsoever. In fact currently when you set the AutoPanMode to Navigation it is horrendously choppy and borderline painful to watch it zoom to your position. I've created a test application with the 10.2 references and setting AutoPanMode to Navigation smoothly pans over to your location but never zooms unless you call some Zoom method afterwards. I'm guessing that's why it used to look so smooth?

Currently this is what I've found creates the same functionality

await MapView.SetViewpointAsync(new Viewpoint(e.Position.Extent), TimeSpan.FromSeconds(1));
await MapView.SetViewpointScaleAsync(300);

The problem is when I do this, the AutoPanMode gets set to Off and the only workaround is to set it back to Navigation right after

await CustomMapView.SetViewpointAsync(new Viewpoint(e.Position.Extent), TimeSpan.FromSeconds(1));
await CustomMapView.SetViewpointScaleAsync(300);
MapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Navigation;

This is not really ideal since it feels a little hacky. Additionally in UWP it causes a bunch of threading issues that crash the app (I can fix that but it looks really gross). Is there a way I can animate my zooming without having to do this?

What had to be done to fix this:

MapView.LocationDisplay.InitialZoomScale = 0;
MapView.LocationDisplay.IsEnabled = true;
MapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Navigation
await Task.Delay(2500);
await MapView.SetViewpointScaleAsync(500);

Rather than setting the viewpoint to your current location, you should probably set the AutoPanMode to Navigation and let that pan you over.

If you want to do that without affecting the zoom, you could set the LocationDisplay.InitialZoomScale to the map's current scale just before you set the AutoPanMode to Navigate.


I'm assuming you're seeing this because the debugger is attached. Try and run it without debugging enabled, and I'm betting it's better.

If this is what you're seeing, I'd encourage you to vote for this Visual Studio issue I logged: https://developercommunity.visualstudio.com/content/problem/899720/debugger-severely-affects-execution-performance-wh.html

At least it's only affecting developers, and won't be an in-production issue.

  • Technically not the fix for my issue but a very very nice thing to know. I will vote for that issue to hopefully get it resolved – DeveloperMan1234 Mar 6 '20 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.