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

Data-Driven Styling Master Ticket #1626

Closed
lucaswoj opened this issue Oct 16, 2015 · 1 comment
Closed

Data-Driven Styling Master Ticket #1626

lucaswoj opened this issue Oct 16, 2015 · 1 comment

Comments

@lucaswoj
Copy link
Contributor

Hello! Most of the action around data-driven styling is now happening in #1932


Implementing data-driven styling is as easy as 1-2-3-4-5-6-7-8

1. Refactor Buffer to design buffer layouts at runtime

Status 🚢

merged in #1526

2. Refactor Bucket to seperate the calculation of each attribute

We are going to implement data-driven styling using disableable shader attributes. This refactoring implements an abstraction that will allow us to turn on and off attributes and use the same logic to calculate an attribute, whether it is disabled or enabled.

Status 🚢

merged from #1620

3. Change shader uniforms to attributes

In order to supply per-feature values to WebGL, we need to convert some shader uniforms to attributes.

This could be challenging because, as we saw in #1336, IE has a big performance penalty for using a disabled attribute instead of a uniform.

Status 💭

previously implemented in #1257 but reverted in #1418 because of #1336

now tracked in #1714

4. Add support for data-driven styles in mapbox-gl-style-spec

Status 🚢

in pull request at mapbox/mapbox-gl-style-spec#399

5. Add support for data-driven styles in mapbox-gl-function

merged in mapbox/mapbox-gl-function#2, overhauled in mapbox/mapbox-gl-function#12

Status 🚢

6. Get mapbox-gl-js running on mapbox-gl-function v2

depends on 5

Status 🚢

7. Create layer classes

We should create a class per layer type (i.e. LineLayer, CircleLayer, FillLayer, ...) like we did in mapbox-gl-native. In the long run, these classes should encapsulate all layer-specific operations, including drawing, bucket building, etc. For data-driven styling, these classes need to be able to tell which shader attributes are enabled / disabled.

Status 🚢

8. Put a bow on it

Add an isDisabled function to the LayerType attributes.
If this function returns false the attribute will not be added to the buffer, disabled with disableVertexAttribArray, and set by vertexAttrib*.
If this function returns true, calculate per-feature paint values using mapbox-gl-function and feed them into the Buffer.

depends on 1 - 6

Status 🚀

in pull request at #1932

@lucaswoj
Copy link
Contributor Author

▶️ #1932

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

No branches or pull requests

2 participants