Search code examples
google-mapsxamarinxamarin.formsxamarin.android

Unable to pan or zoom Xamarin.Forms.GoogleMaps


I am looking to use Xamarin.Forms.GoogleMaps in our application. The maps displays fine and marks the location but we are unable to interact with the map. (ie. pan the map left and right or zoom in/out or play with markers)

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:d="http://xamarin.com/schemas/2014/forms/design"
    xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps"
    Title="Pick your area"
    Shell.TabBarIsVisible="False">
    <ContentPage.Content>

        <AbsoluteLayout>
            <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">

                <maps:Map
                    x:Name="locationMap"
                    HasScrollEnabled="True"
                    HasZoomEnabled="True"
                    HeightRequest="300"
                    MapClicked="locationMap_MapClicked"
                    MapLongClicked="locationMap_MapLongClicked"
                    VerticalOptions="Start" />
                <StackLayout
                    Margin="20,5"
                    Orientation="Horizontal"
                    VerticalOptions="Center">
                    <Label
                        Style="{StaticResource SectionHeaders}"
                        Text="Choose from saved locations:"
                        VerticalTextAlignment="Center" />
                    <Picker
                        Title="Pick address"
                        HorizontalOptions="End"
                        ItemDisplayBinding="{Binding Name}"
                        ItemsSource="{Binding SavedAddresses}"
                        SelectedIndexChanged="Picker_SelectedIndexChanged" />
                </StackLayout>


            </StackLayout>

        </AbsoluteLayout>
    </ContentPage.Content>
</ContentPage>

The application is based on

  • Xamarin Forms 4.5.0
  • Xamarin Form GoogleMaps 3.3.0

It is a shell architecture.

If anyone can help us use it, it would be great help.

Thanks in advance


Solution

  • Sorry, turns out it was really stupid. There was an absolutely placed control of list view that was in hidden state which prevented interaction.