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

Suggestions for the new MAUI Compass #573

Open
espenrl opened this issue May 28, 2024 · 7 comments
Open

Suggestions for the new MAUI Compass #573

espenrl opened this issue May 28, 2024 · 7 comments

Comments

@espenrl
Copy link

espenrl commented May 28, 2024

Hi, I've tested the new Compass implementation in #570 and I want to give some feedback.

<Compass GeoView="{x:Reference MapView}" AutoHide="True" Background="White" />
  • AutoHide seems to work as it should, but the compass isn't initially hidden when map is initialized (map pointing north)
  • Background is not rounded, thus setting a background color is actually a square that extends beyond the circle of the compass
  • Background is not hidden according to AutoHide
image image
@dotMorten
Copy link
Member

Thanks @espenrl Which platform was this one? Are your MAUI workloads up to date?

@espenrl
Copy link
Author

espenrl commented May 29, 2024

Tested on

  • Windows 11
  • .NET 8.0.5
  • MAUI 8.0.40 SR5
  • ArcGIS Maps SDK 200.4.0

The new Compass's code is self contained so I copied Compass.cs into my own project. Straight from the main branch.

@dotMorten dotMorten added this to the 200.5 milestone May 29, 2024
@espenrl espenrl changed the title Suggestions for the new Compass Suggestions for the new MAUI Compass May 29, 2024
@dotMorten
Copy link
Member

@espenrl Aaah I get it now - you're explicitly setting the background to white. When you do that in MAUI the entire control will be white as you see. That's sort of expected. I don't believe we can override that behavior and only apply it to a child element in MAUI.

@dotMorten
Copy link
Member

I logged dotnet/maui#22802 in the hope that we can improve this

@dotMorten dotMorten added Status: Blocked and removed good first issue Good for newcomers labels Jun 3, 2024
@espenrl
Copy link
Author

espenrl commented Jun 8, 2024

I logged dotnet/maui#22802 in the hope that we can improve this

It's funny I've been through the same thoughts and discussion. In the end I personally think it's good that Background applies to the whole control. It aids debugging, being able to paint the whole control - it makes it easy to see how the control is placed in the layout.

Would it be an idea for the Compass control to have a Fill property? Akin to Path.Fill, not the best example perhaps.

@dotMorten
Copy link
Member

Fill would be my preferred property. I can see your argument, but my main issue with having Background fill the entire control is that it goes against how all the other frameworks handle it for templated controls. Imagine something as simple as a border with rounded corners... you wouldn't want the background to stick out outside those round corners.

@espenrl
Copy link
Author

espenrl commented Jun 21, 2024

Compass isn't initially hidden on startup when pointing north. I found that initializing _isVisible to true, as well as removing _isVisible = false; from OnApplyTemplate() helped solve this case.

@dotMorten dotMorten removed this from the 200.5 milestone Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants