Skip to content

fix: colors not working in trip layer of TABLE mode - #3347

Merged
lixun910 merged 1 commit into
masterfrom
xli-fix-trip-layer-color
Feb 27, 2026
Merged

fix: colors not working in trip layer of TABLE mode#3347
lixun910 merged 1 commit into
masterfrom
xli-fix-trip-layer-color

Conversation

@lixun910

Copy link
Copy Markdown
Collaborator

In TABLE mode (when using columns like id/lat/lng/timestamp instead of GeoJSON), the trip layer groups rows by ID to create features. Each feature has:

  • properties.index - the feature index (0, 1, 2, ...), NOT a row index
  • properties.values - an array of all materialized rows belonging to this trip

The bug is in formatLayerData:

const dataAccessor = () => d => ({index: d.properties.index});

This returns {index: featureIndex}, but when valueAccessor({index: featureIndex}) is called, it looks up row featureIndex in the data container, which is the wrong row.

For TABLE mode, the dataAccessor should return the first row from properties.values:

if (this.config.columnMode === COLUMN_MODE_GEOJSON) {
  dataAccessor = () => d => ({index: d.properties.index});
} else {
  // TABLE mode: use the first row from properties.values
  dataAccessor = () => d => d.properties.values[0];
}

@lixun910
lixun910 requested review from Copilot and igorDykhta and removed request for Copilot February 27, 2026 01:05
@lixun910
lixun910 merged commit efb072e into master Feb 27, 2026
10 of 11 checks passed
@lixun910
lixun910 deleted the xli-fix-trip-layer-color branch February 27, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants