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

Anti-aliasing question #149

Closed
Jxlle opened this issue Oct 11, 2024 · 2 comments
Closed

Anti-aliasing question #149

Jxlle opened this issue Oct 11, 2024 · 2 comments

Comments

@Jxlle
Copy link

Jxlle commented Oct 11, 2024

I've recently upgraded to the latest version of the Azure Maps Control package, but I have some issues with the new anti-aliasing (AA) setting on the PolygonLayer. When enabling the setting, my polygons get a dark border around them, as if there is an additional LineLayer drawn with this data source. I don't know if this is by design, so I'll first give my setting and explain it a bit more.

My PolygonLayer consists of several shapes, all rectangles, that are placed next to each other. The shapes share corners, meaning that adjacent shapes share two identical coordinates. This means that there is no space between them. The expected visualization of these shapes is a big rectangle of a singular color, consisting of several smaller rectangles (Because each rectangle has the same fillColor value (and no fillPattern)). However, when enabling the anti-aliasing setting on the layer, I see borders around each shape:
image

When disabling the setting, the borders dissapear:
image

Is it possible that the AA does not take the adjacent shapes into account (which I would expect not to be the case as to how AA usually works)? Or is this effect due to the shapes overlapping?

@rbrundritt
Copy link
Contributor

First off, just set the fillAntialias option to false, as that is the only solution here.

History of this issue:

I came across this a while back, before this option was added to Azure Maps. There is a long story behind it, but basically, the root cause of the issue is not antialiasing specifically, but some other oddity in WebGL (Azure Maps uses MapLibre which is originally a fork of Mapbox gl js, and this issue goes back to at least 2016, and exists in all of them still). This issue doesn't appear too often. You are only the third person that I have had encounter this and mention it in the Azure Maps community in the last 7 years. The first time I didn't think much of it, the second time it came up (last winter) I spent a few days diving into this and eventually figured out the disabling antialiasing helped resolve this issue (or make it less visible). Once I figured that out I reached out to the Azure Maps team and recommended that they expose an option to disable antialiasing so that there is a workaround for this issue for the few data sets that encounter it. This feature is set to true by default as that's what it has been under the hood since the beginning of Azure Maps, and we didn't want to modify the behavior of existing apps, especially since this issue only appears in rare situations. So that new feature was added to provide an option to address this issue, and not the cause of it.

@Jxlle
Copy link
Author

Jxlle commented Oct 12, 2024

Thanks for the info @rbrundritt! Guess I'll close this issue as your answer is clear!

@Jxlle Jxlle closed this as completed Oct 12, 2024
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