Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
217 stars 121 forks source link

Suggestions for the new MAUI Compass #573

Open espenrl opened 5 months ago

espenrl commented 5 months ago

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" />
image image
dotMorten commented 5 months ago

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

espenrl commented 5 months ago

Tested on

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

dotMorten commented 5 months ago

@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 commented 5 months ago

I logged https://github.com/dotnet/maui/issues/22802 in the hope that we can improve this

espenrl commented 5 months ago

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 commented 5 months ago

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 commented 4 months ago

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.