Open TimLariviere opened 4 years ago
I am able to reproduce this issue without a CollectionView, just by having the Zoom disabled and setting the new coordinates using MoveToRegion, it won't update.
Is this getting fixed?
Super hacky workaround:
Set HasZoomEnabled=True
And then:
Device.InvokeOnMainThreadAsync(async () =>
{
await Task.Delay(100);
Map.HasZoomEnabled = false;
});
Description
When using a Xamarin.Forms.Maps.Map control inside a row of ListView or CollectionView, with
HasZoomEnabled
= false, Android centers the map on 0,0 instead of using the given initial region. This also happens if I try to useMoveToRegion
before the Map is fully initialized.But if
HasZoomEnabled
is true, it works as expected.This doesn't happen on iOS, nor does it happen when using the same Map control outside a ListView/CollectionView.
Steps to Reproduce
(To avoid
x:Arguments
) Create a CustomMap class inheriting from MapAdd a CollectionView with an ItemTemplate using the CustomMap with
HasZoomEnabled
= falsePass some data in the ItemsSource property so the rows are displayed
Expected Behavior
The maps should all be centered on the position given (Paris in the example). Just like on iOS:
Actual Behavior
The maps are centered on the default coordinates.
Basic Information
Workaround
No workaround known.