Select to view content in your preferred language

MapView control on Android takes all tapings including from controls above MapView

119
0
04-18-2025 06:23 AM
Labels (2)
GKmieliauskas
Esri Regular Contributor

Hi, 

I have noticed that sometimes on Android MAUI MapView control takes all tapings including from controls above MapView. I have tried to play with InputTransparent property (which is by default is False), and no matter what value I set, behavior is the same.

It is easy to test on community sample "Create mobile geodatabase". You can edit existing arcgis-maps-sdk-dotnet-samples-main\src\MAUI\Maui.Samples\Samples\Data\CreateMobileGeodatabase\CreateMobileGeodatabase.xaml file changing first 3 lines inside ContentPage. From:

    <Grid Style="{DynamicResource EsriSampleContainer}">
        <esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
        <Border Style="{DynamicResource EsriSampleControlPanel}">

To:

    <Grid ColumnDefinitions="*,Auto" Style="{DynamicResource EsriSampleContainer}">
        <esriUI:MapView x:Name="MyMapView" Grid.ColumnSpan="2" Style="{DynamicResource EsriSampleGeoView}" />
        <Border Grid.Column="1" Style="{DynamicResource EsriSampleControlPanel}" InputTransparent="False">

 Tap somewhere below "Close and share" button and you will catch MyMapView_GeoViewTapped event.

ArcGIS Runtime 200.7, but the same behavior with oldest versions.

Workaround, I have found, is add to each control TapGestureRecognizer with "empty" Command like below:

            <Border.GestureRecognizers>
                <TapGestureRecognizer />
            </Border.GestureRecognizers>

It's ok if you have one control on top of MapView. In our case, we have several controls (buttons), hided/visible dock panels and etc. We don't want to change MapView width when dockpanels changes visibility state because it requires MapView refreshing.

Any help would be appreciated.

Tags (3)
0 Kudos
0 Replies