Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapControl: MapElementClick event does not fire #9487

Closed
tipa opened this issue Mar 26, 2024 · 1 comment
Closed

MapControl: MapElementClick event does not fire #9487

tipa opened this issue Mar 26, 2024 · 1 comment
Labels
area-MapControl bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). team-Controls Issue for the Controls team
Milestone

Comments

@tipa
Copy link
Contributor

tipa commented Mar 26, 2024

Describe the bug

The MapElementClick event does not seem to fire when clicking a map icon that has been added to the map

Steps to reproduce the bug

<MapControl x:Name="map" MapServiceToken="XYZ">
    <MapControl.Layers>
        <MapElementsLayer x:Name="elem_layer" />
    </MapControl.Layers>
</MapControl>

var mapIcon = new Microsoft.UI.Xaml.Controls.MapIcon();
var pos = new Windows.Devices.Geolocation.BasicGeoposition { Latitude = 20, Longitude = 20 };
mapIcon.Location = new Windows.Devices.Geolocation.Geopoint(pos);
elem_layer.MapElements.Add(mapIcon);
map.MapElementClick += (s, e) =>  System.Diagnostics.Debug.WriteLine(e.Location); // <-- this is never called

Expected behavior

Event handler fires when map element is clicked

NuGet package version

WinUI 3 - Windows App SDK 1.5.1: 1.5.240311000

Windows version

Windows 11 (22H2): Build 22621

@tipa tipa added the bug Something isn't working label Mar 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Mar 26, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@codendone codendone added team-Controls Issue for the Controls team area-MapControl and removed needs-triage Issue needs to be triaged by the area owners labels Apr 5, 2024
@llongley llongley added this to the WinAppSDK 1.6 milestone Apr 17, 2024
@llongley llongley added the closed-Fixed Described behavior has been fixed. label Apr 17, 2024
@codendone codendone added the fix-released The fix has been in a release (experimental, preview, stable, or servicing). label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-MapControl bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

3 participants