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

Adding multiple polylines to a Map messes up existing polyline #22510

Closed
SupermindPT opened this issue May 19, 2024 · 2 comments
Closed

Adding multiple polylines to a Map messes up existing polyline #22510

SupermindPT opened this issue May 19, 2024 · 2 comments
Labels
area-controls-map Map / Maps platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@SupermindPT
Copy link

Description

Im using a Microsoft.Maui.Controls.Maps.Map control to display routes to the user. I draw polylines based on the current user location, so as the user is moving I change the polyline accordingly.

When adding a new polyline to the map when another already exists, causes the existing polyline to change unexpectedly.
As you can see in the image, as soon as a new polyline is added to the map, the existing one changes unexpectedly.
Screenshot_1716155068
Screenshot_1716155077

The existing polyline becomes incorrect, one points is connected to two or more points of the polyline.
map

The last point of the polyline should be connected to the point before (n-1) only, but points are connected unexpectedly.
I can replicate this issue with emulator and physical device, and it seems that upon redrawing the MapElements (reloading the page) the polyline is fixed.
Screenshot_1716155164

Steps to Reproduce

  1. Create a new .NET MAUI project.
  2. Create a page with a Map control from the Microsoft.Maui.Controls.Maps.Map namespace.
  3. Add a polyline to the map
  4. Add another polyline to the map
  5. The first polyline is now messed up.

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 21 and up

Did you find any workaround?

I have not found any workaround yet, but it seems that reloading the page and consequently the Map control, will draw the polylines correctly.

Relevant log output

No response

@SupermindPT SupermindPT added the t/bug Something isn't working label May 19, 2024
Copy link
Contributor

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 and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

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

@jaosnz-rep jaosnz-rep added the s/triaged Issue has been reviewed label May 21, 2024
@jsuarezruiz jsuarezruiz added the s/needs-repro Attach a solution or code which reproduces the issue label Jun 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Jun 11, 2024
@SupermindPT
Copy link
Author

I figured out a fix incase someone has the same problem. Before adding a new polyline to the map, just invoke:

existingPolyline.Handler.DisconectHandler();

on the already existing polyline. This will prevent further changes to the existing polyline, and there is not need to create a custom handler for the polyline.

@dotnet-policy-service dotnet-policy-service bot removed the s/no-recent-activity Issue has had no recent activity label Jul 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-map Map / Maps platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants