-
Notifications
You must be signed in to change notification settings - Fork 1.9k
iOS map clicked event fires when tap on pin #11532
Copy link
Copy link
Closed
Labels
area-controls-mapMap / MapsMap / Mapsfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.58Look for this fix in 7.0.58!Look for this fix in 7.0.58!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/iost/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
Click/tap on the map pin expands it but on iOS the map fires MapClicked event as well. Same code works on Android as expected (pin reacts on event but the map event callback is not called)
Expected result:
Pin control expands on click/tap + map MapClicked event does NOT fire
iOS Actual result:
Pin control expands on click/tap + map MapClicked event FIRES
Tested on Mac with maui-ios 7.0.100 and on Windows with SDK 7.0.100
Steps to Reproduce
Create a new project. Add map
Replace MainPage with code below
MainPage
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var pinLocation = new Location(20.7557, -155.9880);
MapSpan mapSpan = MapSpan.FromCenterAndRadius(pinLocation, Distance.FromKilometers(3));
map.MoveToRegion(mapSpan);
map.Pins.Add(new Pin
{
Label = "MAUI Test Pin",
Location = pinLocation
});
}
async void OnMapClicked(object sender, MapClickedEventArgs e)
{
await DisplayAlert("Map", $"Area {e.Location.Latitude}, {e.Location.Longitude} clicked.", "Ok");
}
}
MainPage.Xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiMapTest.MainPage"
Title="MapPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Map x:Name="map"
IsShowingUser="True"
MapClicked="OnMapClicked"
Grid.Row="0"
Grid.ColumnSpan="2" />
</Grid>
</ContentPage>
Link to public reproduction project repository
https://github.com/bivant/MAUI_MapTest/tree/mapPinClickedFallthrough
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16.1 (simulator)
Did you find any workaround?
No response
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-mapMap / MapsMap / Mapsfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.58Look for this fix in 7.0.58!Look for this fix in 7.0.58!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/iost/bugSomething isn't workingSomething isn't working




