-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Provide "fill-stroke-*" properties and rename "fill" to "polygon" #4087
Comments
From @ljbade on November 21, 2014 7:42 Can't you just do two passes for this layer? Just reuse fill and line code, but do two passes. |
From @mourner on November 21, 2014 15:1
Yes, this may lead to people inadvertently producing extremely sluggish styles. E.g. adding a line building layer in addition to fill layer — the performance hit is noticeable right away. |
From @mourner on December 24, 2014 7:57
@nickidlugash yes, as long as we don't differentiate between outlines that are always 1px and never change, and lines with bigger widths — the first is rendered in the same pass/shader as fill without any additional processing or geometry data, while the second needs much more data to render and a different pass, leading to worse framerate and slower tile loading. |
From @ansis on January 23, 2015 4:8 I agree that we should kill I'm not convinced that we should add a polygon type though.
It is tedious to create a second layer for the stroke with the same data as the fill layer. A polygon type would fix this. But maybe it could be fixed by adding a way to reference other layer's data, or maybe by letting UIs handle it with an "add line" button for fill layers. If we add a SVG-like polygon, would we add SVG-like lines with strokes and fills too? This reminds me of the idea to allow a single layer to have multiple types, which could feel a bit more like carto. For example, |
From @nickidlugash on June 10, 2015 17:40 @ansis @jfirebaugh @mourner Can we address this for |
From @jfirebaugh on June 10, 2015 18:0 This is out of scope for v8 -- we don't have a good lead on implementing it and it's lower priority than other features that are not currently planned for v8 like data-driven styles. |
From @nickidlugash on June 10, 2015 18:36 Ok, but I'm pretty hesitant for us to launch the app with the |
From @incanus on July 4, 2015 16:27 |
@mourner Is this easier to do with earcut? |
As part of Qt integration, providing |
+1 for outline stroke width. the ability to have a thick border outline with no fill, for example, seems quite important. |
@jdeboer-geoplan it's a bug in the geometries you are sending over to GL JS. Your geometries are overlapping. You must create geometries with holes to make them non overlapping to model what you are trying to do. |
Hi @mb12 yeah I could cut up my geometries to remove overlap for the opaque case but if the polygons are semi-transparent I can't do that. I think I'd expect progressively occluded polygon edges. Which should look something like this |
I think this is a great idea. We've run into a limitation where we want our polygon layers to have thicker strokes, but doing so requires applying a The result is that our polygon with "strokes" don't preserve the actual area of the polygon: Perhaps a |
I guess |
Rather than stroke properties why not adapt the line styles to apply to polygon typeas stroke styles? Under the mapboxgl hood you could use the same source multiple times one pass for the fill using fill paint properties and and a pass for each polygon ring if line styles are defined for a polygon source (so if you have a donut the outer ring and empty inner ring would have the same line style). If you don't like doing this for the "fill" type, maybe add a "stroked-fill" type. |
@DannyDelott Out of interest, how did you end up fixing the issue with your stroke layers. I have a similar issue where the stroke of say 10px is rendered at the "center", so 5px of the stroke is inside the actual area, and 5px outside. |
Just wanted to upvote this, as we have a very similar requirement; a semi-transparent polygon with an opaque border. Our current workaround is to use two layers, one fill and one line. This works but is a bit inconvenient since we want to toggle their visibility programatically and thus have to handle more layers in code. Also a little confusing as Mapbox Studio makes it look like this should be possible to do with just one layer. |
+1 for this although the issue has been open for quite a while. I would really like to be able to use |
From @jfirebaugh on November 21, 2014 3:46
Pros:
fill-outline-color
is a hack (experiment with using this as a server-side renderer #199)Cons:
Copied from original issue: mapbox/mapbox-gl-style-spec#223
The text was updated successfully, but these errors were encountered: