From f003cfd3886adb85cd6dd10e8083bc82abb68234 Mon Sep 17 00:00:00 2001 From: adrianknight89 Date: Tue, 3 Jan 2017 05:35:54 -0600 Subject: [PATCH] [iOS/Android] Move Map camera to correct region on layout change (#548) * Move to region on layout change * remove visibility check --- Xamarin.Forms.Maps.Android/MapRenderer.cs | 1 + Xamarin.Forms.Maps.iOS/MapRenderer.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Xamarin.Forms.Maps.Android/MapRenderer.cs b/Xamarin.Forms.Maps.Android/MapRenderer.cs index f83b6fad8..3316faa54 100644 --- a/Xamarin.Forms.Maps.Android/MapRenderer.cs +++ b/Xamarin.Forms.Maps.Android/MapRenderer.cs @@ -186,6 +186,7 @@ namespace Xamarin.Forms.Maps.Android else if (changed) { UpdateVisibleRegion(NativeMap.CameraPosition.Target); + MoveToRegion(Element.LastMoveToRegion, false); } } diff --git a/Xamarin.Forms.Maps.iOS/MapRenderer.cs b/Xamarin.Forms.Maps.iOS/MapRenderer.cs index 3f4e7eb66..af1f08083 100644 --- a/Xamarin.Forms.Maps.iOS/MapRenderer.cs +++ b/Xamarin.Forms.Maps.iOS/MapRenderer.cs @@ -190,7 +190,7 @@ namespace Xamarin.Forms.Maps.iOS UpdateHasScrollEnabled(); else if (e.PropertyName == Map.HasZoomEnabledProperty.PropertyName) UpdateHasZoomEnabled(); - else if (e.PropertyName == VisualElement.IsVisibleProperty.PropertyName && ((Map)Element).LastMoveToRegion != null) + else if (e.PropertyName == VisualElement.HeightProperty.PropertyName && ((Map)Element).LastMoveToRegion != null) _shouldUpdateRegion = true; }