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

[Bug Android]Overlays sometimes are not drawn on the Map or not at the good Coordinates. #89

Open
Phenek opened this issue Sep 18, 2018 · 8 comments

Comments

@Phenek
Copy link
Contributor

Phenek commented Sep 18, 2018

Description

On Android, Overlays sometimes are not drawn on the Map or not at the good coordinates.
Maybe caused by the MoveToRegion when drawing at the same time.

Expected Behavior

The Overlays have to be at the correct coordinates with the good proportion.

@Phenek
Copy link
Contributor Author

Phenek commented Sep 18, 2018

Also I think Unified Map have to be refactored at some points
Separate Pin, Overlay, Polyline logics in different files to be more readable.
Let me know what to you expect?
regards,

@Phenek
Copy link
Contributor Author

Phenek commented Sep 19, 2018

OnMapReady on Android should draw Overlays & Polylines if some were added before.

@Phenek
Copy link
Contributor Author

Phenek commented Sep 19, 2018

MoveToRegion could be async or a new MoveToRegionAsync?
Then we will able to wait the camera animation and then draw the Overlay.

@veryhumble
Copy link
Member

Should drawing the overlay not be on the map coordinates? It should have no impact if camera is moving or not, right?

@Phenek
Copy link
Contributor Author

Phenek commented Sep 19, 2018

It should, but on Android drawing an Overlay just before or after calling Map.MoveToRegion with animation true
is drawing the Overlay sometimes on wrong coordinates, sometimes it disappear, sometimes never saw it.

Map.MoveToRegion(new MapRegion(new Position(48.853401, 2.348779), 400)), true);
Overlays.Add(new CircleOverlay
  {
    Location = new Position(48.853401, 2.348779),
    Radius = 400,
     Color = Color.Navy.MultiplyAlpha(0.2),
     FillColor = Color.Blue.MultiplyAlpha(0.2)
});

@veryhumble
Copy link
Member

Ok, i see.

Fixing this is making sure the overly drawing is not dependent on a camera move or current visual region. The question is, why does the camera movement have an effect on drawing overlays?

You're proposal of add a async MoveToRegion and wait before drawing a circle would still result in some weird visual behavior?

Haven't looked at the code yet, just thinking about how it should behave.

@Phenek
Copy link
Contributor Author

Phenek commented Sep 19, 2018

I do not really look at the problem closely.
But that's why I suggested placing the different logic in separate files
like they do on this repo

@Phenek
Copy link
Contributor Author

Phenek commented Sep 19, 2018

I tried that

Overlays.Add(new CircleOverlay
   {
     Location = new Position(48.853401, 2.348779),
      Radius = 400,
      Color = Color.Navy.MultiplyAlpha(0.2),
      FillColor = Color.Blue.MultiplyAlpha(0.2)
   });
await Task.Run(() => Task.Delay(5000));
Map.MoveToRegion(new MapRegion(new Position(48.853401, 2.348779), 400), true);

It's seems that the move to region is just removing the Overlay even if it was draw at good coordinates with good proportions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants