You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm importing GeoJSON into a mapbox map, I have two data sets, lines and points. My lines require different styling based on criteria in the properties in the GeoJSON.
For line-color, the data driven properties work fine. My issue is that some of my lines need a border/outline on, so to resolve this I'm using a repeatable pattern. However, I only want this to be on certain lines, not all. I thought that maybe adding null as the default would achieve this, however it doesn't. line-pattern overrides line-color, which would be fine if I could null the pattern when I want the color, but I can't.
I'd like to avoid making two sets of GeoJSON just for lines, it'll get quite unwieldy.
Design Alternatives
Allow a null value in data driven styles, which would equivalate to not having a value there at all for that specific map feature.
Mock-Up
To a developer this would look similar to the below:
paint: {
'line-color': [
'match', ['get', 'my_property'],
'outline_please', 'my-outline-style',
null // this is the default
]
}
Implementation
Don't think too much would have to change in order to implement this but I'm not particularly familiar with the source code for Mapbox GL so I could be wrong here.
The text was updated successfully, but these errors were encountered:
@hjbdev Thanks for opening this request. I am closing this because it is a duplicate of #8331. A work-around has been posted at #8331 (comment) until this functionality is available.
Motivation
I'm importing GeoJSON into a mapbox map, I have two data sets, lines and points. My lines require different styling based on criteria in the properties in the GeoJSON.
For
line-color
, the data driven properties work fine. My issue is that some of my lines need a border/outline on, so to resolve this I'm using a repeatable pattern. However, I only want this to be on certain lines, not all. I thought that maybe addingnull
as the default would achieve this, however it doesn't.line-pattern
overridesline-color
, which would be fine if I could null the pattern when I want the color, but I can't.I'd like to avoid making two sets of GeoJSON just for lines, it'll get quite unwieldy.
Design Alternatives
Allow a null value in data driven styles, which would equivalate to not having a value there at all for that specific map feature.
Mock-Up
To a developer this would look similar to the below:
Implementation
Don't think too much would have to change in order to implement this but I'm not particularly familiar with the source code for Mapbox GL so I could be wrong here.
The text was updated successfully, but these errors were encountered: