bug: Fix the priority of styles used for tracks.
Before, the main style had priority over the past/current/future style,
which was not the intent.
Resolves
MODIFY
src/trackFeature.js
src/trackFeature.js
@@ -275,8 +275,8 @@ var trackFeature = function (arg) {
m_tracks.textFunc = m_this.style.get('text');
['past', 'current', 'future'].forEach(key => {
m_lineFeatures[key]
- .style(m_this[key + 'Style']())
.style(m_this.style())
+ .style(m_this[key + 'Style']())
.line(m_this.style('track'))
.gcs(m_this.gcs())
.data(data)

MODIFY
tests/cases/trackFeature.js
tests/cases/trackFeature.js
@@ -380,11 +380,18 @@ describe('geo.trackFeature', function () {
.track(function (d) { return d.t; })
.position(function (d, i, t, j) { return {x: testTracks[j].x[i], y: testTracks[j].y[i]}; })
.time(function (d, i, t, j) { return d; })
+ .style('strokeOpacity', 0.25)
+ .pastStyle('strokeOpacity', 0.8)
+ .currentStyle('strokeOpacity', 0.85)
+ .futureStyle('strokeOpacity', 0.9)
.style('text', function (d, i) { return i % 2 ? testTracks[i].id : undefined; });
track.draw();
expect(layer.children().length).toBe(6);
expect(layer.children()[4].features()[0] instanceof geo.webgl.markerFeature).toBe(true);
expect(layer.children()[5] instanceof geo.canvas.textFeature).toBe(true);
+ // check that specific style has priority over general style
+ expect(layer.children()[3] instanceof geo.canvas.lineFeature).toBe(true);
+ expect(layer.children()[3].style.get('strokeOpacity')(0, 0)).toBe(0.85);
layer.deleteFeature(track);
expect(layer.children().length).toBe(0);
destroyMap();

bug: Fix the priority of styles used for tracks.

Before, the main style had priority over the past/current/future style,
which was not the intent.

Resolves #1164.