Skip to content

Commit

Permalink
Add test for switching between fill and fillextrusion buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Oct 26, 2016
1 parent 19c12a0 commit 91786e7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/js/style/style.test.js
Expand Up @@ -1194,6 +1194,34 @@ test('Style defers expensive methods', (t) => {
});
});

test('Style updates source to switch fill[-extrusion] bucket types', (t) => {
// Runtime switching between non-extruded and extruded fills requires
// switching bucket types, so setPaintProperty in this case should trigger
// a worker roundtrip (as also happens when setting property functions)

const style = new Style(createStyleJSON({
"sources": {
"streets": createGeoJSONSource(),
"terrain": createGeoJSONSource()
}
}));

style.on('style.load', () => {
style.addLayer({ id: 'fill', type: 'fill', source: 'streets', paint: {}});
style.update();

t.notOk(style._updates.sources.streets);

style.setPaintProperty('fill', 'fill-color', 'green');
t.notOk(style._updates.sources.streets);

style.setPaintProperty('fill', 'fill-extrude-height', 10);
t.ok(style._updates.sources.streets);

t.end();
});
});

test('Style#query*Features', (t) => {

// These tests only cover filter validation. Most tests for these methods
Expand Down

0 comments on commit 91786e7

Please sign in to comment.