Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[node] Also Update::Classes when setting a paint property #5614

Merged
merged 2 commits into from
Jul 8, 2016

Conversation

tmpsantos
Copy link
Contributor

Otherwise it has no effect. Tests might be working because a Update::Classes is also scheduled when adding a new layer.

@tmpsantos tmpsantos force-pushed the tmpsantos-node_set_paint_property branch from 474c364 to e2cd434 Compare July 7, 2016 18:20
@tmpsantos
Copy link
Contributor Author

👀 @jfirebaugh @yhahn

This explains why this code on Qt was only working if foobar layer was being added. The code was based on the node code and was only doing a RecalculateStyle.

            QVariantMap foobar;
            foobar["id"] = "foobar";
            foobar["type"] = "fill";
            foobar["source"] = "composite";

            // Commenting this line was making the next statements stop to work.
            // Adding Update::Classes to ::setPaintProperty() fixed.
            m_map.addLayer(foobar);

            m_map.setPaintProperty("water", "fill-color", "red");
            m_map.setPaintProperty("building", "fill-color", "red");
            m_map.setPaintProperty("road-secondary-tertiary", "line-color", "red");

@jfirebaugh
Copy link
Contributor

Any idea why the paint-property-* tests don't surface this issue?

@tmpsantos tmpsantos force-pushed the tmpsantos-node_set_paint_property branch 2 times, most recently from 66e88ee to c8d7356 Compare July 8, 2016 11:16
@tmpsantos
Copy link
Contributor Author

tmpsantos commented Jul 8, 2016

Any idea why the paint-property-* tests don't surface this issue?

Correct me if I'm wrong, but these are not render tests are they? Internally the layer gets changed correctly, I think the issue is the render buckets don't get updated.

Otherwise it has no effect. Tests might be working because a
Update::Classes is also scheduled when adding a new layer.
@tmpsantos tmpsantos force-pushed the tmpsantos-node_set_paint_property branch from c8d7356 to 01f5b6e Compare July 8, 2016 13:27
@tmpsantos tmpsantos merged commit 01f5b6e into master Jul 8, 2016
@tmpsantos tmpsantos deleted the tmpsantos-node_set_paint_property branch July 8, 2016 13:30
@mikemorris mikemorris added the Node.js node-mapbox-gl-native label Jul 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants