This library currently creates a separate layer for each individual geometry or feature in the GeoJSON input in order to style it distinctly. Instead, it should create one each of symbol, line, and fill layers and set each layout or paint property to a property function that looks at the relevant property on each feature. Reducing the number of layers could improve performance and would also give us more flexibility with respect to z-ordering.
The following layout and paint properties would need to support data-driven styling:
[x] icon-image: mapbox/mapbox-gl-native#8592
[x] line-color
[x] line-opacity
[x] line-width: mapbox/mapbox-gl-js#3045
[x] fill-color
[x] fill-opacity
DDS support for icon-allow-overlap, icon-size, line-cap, and line-join is unnecessary (although it’s already supported for icon-size) because we apply these properties to every symbol or line layer unconditionally.
Incidentally, mapbox/mapbox-gl-js#4087 would make it possible to remove the workaround that clones a path in order to give it both a fill and a stroke with customizable width (stroke-width).
This library currently creates a separate layer for each individual geometry or feature in the GeoJSON input in order to style it distinctly. Instead, it should create one each of symbol, line, and fill layers and set each layout or paint property to a property function that looks at the relevant property on each feature. Reducing the number of layers could improve performance and would also give us more flexibility with respect to z-ordering.
The following layout and paint properties would need to support data-driven styling:
icon-image
: mapbox/mapbox-gl-native#8592line-color
line-opacity
line-width
: mapbox/mapbox-gl-js#3045fill-color
fill-opacity
DDS support for
icon-allow-overlap
,icon-size
,line-cap
, andline-join
is unnecessary (although it’s already supported foricon-size
) because we apply these properties to every symbol or line layer unconditionally.Incidentally, mapbox/mapbox-gl-js#4087 would make it possible to remove the workaround that clones a path in order to give it both a fill and a stroke with customizable width (
stroke-width
)./cc @bsudekum @jfirebaugh