@@ -243,7 +243,7 @@ export default class TripLayer extends Layer {
243243 }
244244
245245 static findDefaultLayerProps (
246- { label, fields = [ ] , dataContainer, id} : KeplerTable ,
246+ { label, fields = [ ] , dataContainer, id, fieldPairs = [ ] } : KeplerTable ,
247247 foundLayers ?: any [ ]
248248 ) {
249249 const geojsonColumns = fields . filter ( f => f . type === 'geojson' || f . type === 'geoarrow' || f . type === 'geoarrow-wkb' ) . map ( f => f . name ) ;
@@ -277,6 +277,39 @@ export default class TripLayer extends Layer {
277277 } ;
278278 }
279279
280+ // Try to detect table columns (id/lat/lng/timestamp) for table column mode
281+ // This allows creating trip layers from tabular data without GeoJSON
282+ if ( fieldPairs . length && fields . length ) {
283+ // Default layer columns for table mode
284+ const defaultTableColumns = {
285+ id : { value : null , fieldIdx : - 1 } ,
286+ lat : { value : null , fieldIdx : - 1 } ,
287+ lng : { value : null , fieldIdx : - 1 } ,
288+ timestamp : { value : null , fieldIdx : - 1 } ,
289+ altitude : { value : null , fieldIdx : - 1 , optional : true } ,
290+ geojson : { value : null , fieldIdx : - 1 }
291+ } ;
292+
293+ const tableColumns = detectTableColumns (
294+ { fields, fieldPairs} as KeplerTable ,
295+ defaultTableColumns ,
296+ 'timestamp'
297+ ) ;
298+
299+ if ( tableColumns ) {
300+ // Found required columns for table mode
301+ return {
302+ props : [ {
303+ label : tableColumns . label || ( typeof label === 'string' && label . replace ( / \. [ ^ / . ] + $ / , '' ) ) || this . type ,
304+ columns : tableColumns . columns ,
305+ isVisible : true ,
306+ columnMode : COLUMN_MODE_TABLE
307+ } ] ,
308+ foundLayers
309+ } ;
310+ }
311+ }
312+
280313 return { props : [ ] } ;
281314 }
282315
0 commit comments