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

Area style stroke-width is ignored #121

Closed
andreynovikov opened this issue Aug 10, 2016 · 10 comments
Closed

Area style stroke-width is ignored #121

andreynovikov opened this issue Aug 10, 2016 · 10 comments
Labels

Comments

@andreynovikov
Copy link

I've tried to set wide outline for area (3.0 in my case) and didn't get desired result.

@devemux86
Copy link
Collaborator

devemux86 commented Aug 10, 2016

Probably something in PolygonBucket GL calls?

@devemux86
Copy link
Collaborator

devemux86 commented Aug 10, 2016

See commit 3c9e18d in issue_121 branch how it fixes the problem.

Currently we use the HairLineBucket width 2 everywhere, set in above line.
Thorough testing is needed to check map's rendering after the change.

@hjanetzek any hint on this?

@devemux86 devemux86 added the bug label Aug 10, 2016
@hjanetzek
Copy link

The Area outline was mainly intended to get cheap anti-aliasing.The maximal GL_LINES width is hardware dependent and thicker lines would also have ugly cut-offs on steep angles. For hi-dpi displays 4px may look ok though, if the hardware supports it.

For thicker lines one should use an additional LineLayer

@devemux86
Copy link
Collaborator

devemux86 commented Aug 10, 2016

The maximal GL_LINES width is hardware dependent and thicker lines would also have ugly cut-offs on steep angles.

@hjanetzek thanks for the info, indeed with the change too large values have visual artifacts.

OpenGL is different in many ways than software rendering, we must keep that in mind.

@andreynovikov
Copy link
Author

For thicker lines one should use an additional LineLayer

This is how I do it now, but the problem with line is that it does not support smooth fading, so my area fades but line stays solid.

@devemux86 devemux86 removed the bug label Aug 11, 2016
@devemux86
Copy link
Collaborator

I find line fade working.
It needs good care the fade value not being smaller than the zoom where the element actually exist in the map.

@andreynovikov
Copy link
Author

Do you mean just disappearing or smooth transparency change?

@devemux86
Copy link
Collaborator

devemux86 commented Aug 11, 2016

The fade works similar in lines and areas, also behaves like the zoom-min.

If setting zoom-min="14" or fade="14" in the theme, but the data were declared with zoom-appear="15" in tag-mapping, then they'll appear on zoom 15 and the fade will not work too.

@devemux86
Copy link
Collaborator

I think we can close this.

@devemux86
Copy link
Collaborator

Better use separate lines for area outlines to avoid rendering problems:

Before:
1

After:
2

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

No branches or pull requests

3 participants