-
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
Implement property functions for "line-dasharray" and "line-cap" #3045
Comments
This is currently blocked by implementation difficulties. |
Re:
One thing we actually might consider, now that the line-width scaling happens in the shader and acts essentially like its own property function, is adding a new property like This would enable something like |
@lbud we talked about a variation of this (adding a new |
(we could also use something like |
I edited the title of this because |
Is it possible to have one line atlas and line atlas texture for each tile, like we're planning to do for glyph and icon atlases? |
@jfirebaugh probably. That might be helpful in the approach I'm working on for data-driven line-caps then (which is to create both round and non-round lines in the line atlas for each dash pattern and be able to pick the right one in the shader, which will increase the line atlas area used — this would limit us to 32 distinct line-dasharray patterns per line atlas) 🕵️♀️ |
(Although I think we should also be able to save space in the line atlas, if we need to, by utilizing r/g/b channels — right now it only utilizes the alpha channel.) |
Style refactors should proceed for now without these properties — they are very complicated:
|
Yeah, this seems pretty intractable as things currently stand. One possibility that @nickidlugash and I talked about was imposing a restriction on the type of style function that's allowed so that we can know all of its possible outputs ahead of time. E.g. (using the forthcoming expression syntax) "data-driven This would mitigate the zaniness and overflow issues, at the expense of weird restrictions we'd have to explain & implement 🤷♂️ |
@lbud @jfirebaugh Any initial thoughts on this option? ^ |
I think we should first investigate using per-tile line atlases. We had great results for per-tile glyph and sprite atlases, and doing the same for lines in theory allows us to make |
@jfirebaugh @lbud that sounds great 👍 Any idea when the team might have bandwidth to look into this? Right now I'm working on the assumption that we will not have DDS values for these properties in the near future (but if there is a possibility of getting these implemented soon, I'd be happy to do whatever I can on my end to make it happen). |
@jfirebaugh @lbud @anandthakker given that we do now have restrictions on use of expressions in |
Just following up on @nickcordella last question to @jfirebaugh, @lbud, @anandthakker on December 11th. |
The answer is "we don't know, and haven't had time to investigate". |
Ok thanks. This is a high priority item for our team Thanks |
So is the "line-dasharray" data driven now? I'm using v0.48.0 and its telling me "property functions not supported" when using this.
|
no, it is not implemented yet and that is why this issue is still open. you can see full support details on the style-spec documentation https://www.mapbox.com/mapbox-gl-js/style-spec/#paint-line-line-dasharray |
Hi there, any update about the status of this feature request ? Thank you |
Is this feature on a short, mid or long term roadmap? In my case, based on the feature properties I want to display some LineStrings as dashed lines, others as regular solid lines. |
@NameFILIP this continue to be on our long term roadmap, but is not scheduled to be worked on anytime soon.
For now, the best way to do this would be to use filters to style the lines as part of different layers |
Is there any indication if this will be worked on this year? Data driven styling is a lot more manageable then creating a layer per |
For the record, If anybody wants to implement something like @lbud showed using the current API, you could split your layers to match the line-width and the line-dasharray at "equal" size. In my use case I only care about line-widths of 1, 2 and 3px so it's relatively simple. [
{
id: 'line-dashed-small',
type: 'line',
paint: {
'line-width': ['get', 'width'],
'line-dasharray': [4, 4]
},
filter: ['==', 'width', 1]
},
{
id: 'line-dashed-large',
type: 'line',
paint: {
'line-width': ['get', 'width'],
'line-dasharray': [2, 2]
},
filter: ['==', 'width', 2]
},
{
id: 'line-dashed-xlarge',
type: 'line',
paint: {
'line-width': ['get', 'width'],
'line-dasharray': [1, 1]
},
filter: ['>', 'width', 2]
}
] |
@asheemmamoowala |
@zstadler I don't think it is fair to communicate that an issue is |
@asheemmamoowala |
Data-driven styling for |
This has just landed and will be a part of the upcoming GL JS v2.3 release! |
Implementing property functions for
line-dasharray
will require sharing information aboutLineAtlas
with the worker, much like the*-pattern
properties #2732The text was updated successfully, but these errors were encountered: