Map freezes when rotating screen on iOS

1031
6
09-11-2017 06:56 PM
BrianMarchionni1
New Contributor II

I've written an application using Xamarin Forms with the ArcGIS Runtime 100.1 on iOS I'm seeing the map freeze when rotating from landscape to portrait or when the map is resized, this does not happen on Android or UWP. This is notably easier to reproduce when location is on. I've written a sample app which reproduces the behavior. I'm not sure if this is related to having two maps in my application or not but I've included this feature in my sample. 

A work around or patch would be greatly appreciated. 

Thanks, 

Brian 

0 Kudos
6 Replies
RichZwaap
Occasional Contributor III

This issue has been fixed for the Update 2 release.  I've also put together a workaround that you can use in the meantime, which is included in the attached sample application.  To use the workaround:

  1. Add the GeoViewExtensions.cs file to your application
  2. Call PauseRendering on your GeoView (MapView or SceneView) before the view is resized
  3. Call ResumeRendering on your GeoView after the view is done resizing

Note that this workaround is specific to version 100.1.  It is very possible that it will not work with any other release.

Hope this helps.

-Rich

0 Kudos
BrianMarchionni1
New Contributor II

Thanks!

0 Kudos
BrianMarchionni1
New Contributor II

Hi Rich, 

I'm trying to implement your work around and I realize now that its for a Xamarion.iOS app. Is there a version that works with Xamarin forms?

Thanks,

Brian

0 Kudos
RichZwaap
Occasional Contributor III

I've attached a Xamarin Forms version that contains the workaround for iOS.  Note that you'll need to override the OnSizeAllocated method in the page that contains your MapView or SceneView and call PauseRendering/ResumeRendering there.  In the sample, that's done in the MapPage.iOS.cs file that's included in the MapPage.iOS project.

-Rich

0 Kudos
BrianMarchionni1
New Contributor II

That got it working, thanks!

0 Kudos
BrianMarchionni1
New Contributor II

Hi Rich, 

I'm still experiencing this freeze intermittently. I'd say maybe 20% of the time if I resize the map it freezes. Any suggestions on how to make the fix more robust?

Thanks,

Brian

0 Kudos