Skip to content

Fix Changing Location on a Pin does nothing #30201

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue details

Changing the Location property on a Microsoft.Maui.Controls.Maps.Pin does not change the location of the Pin on the map.

Root cause

MapPinHandler.Android.cs was only updating the MarkerOptions object when the Location property changed
The actual Marker object already added to the map was not being updated, causing the pin to stay in its original location

Description of change

  • Improved marker association logic: Updated the AddPins method in MapHandler to store marker references in the MapPinHandler for future property updates, ensuring tighter integration between pins and markers.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #12916

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jun 25, 2025
Copy link
Contributor

Hey there @@NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jun 25, 2025
@jsuarezruiz jsuarezruiz added the area-controls-map Map / Maps label Jun 26, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review June 27, 2025 12:57
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner June 27, 2025 12:57
@NirmalKumarYuvaraj
Copy link
Contributor Author

Could you include the sample from the issue in the Gallery? https://github.com/dotnet/maui/tree/main/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries

@jsuarezruiz , i have modified the gallery and introduced a move pin button to update the pin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-map Map / Maps community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] [Regression from Xamarin.Forms.Maps] Changing Location on a Pin does nothing
2 participants