Skip to content

Commit bde8c53

Browse files
committed
name new point layer using label if provided
1 parent cf76bba commit bde8c53

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/layers/src/point-layer/point-layer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export default class PointLayer extends Layer {
328328
}
329329

330330
static findDefaultLayerProps(dataset: KeplerTable) {
331-
const {fieldPairs = [], type} = dataset;
331+
const {fieldPairs = [], type, label} = dataset;
332332

333333
const props: FindDefaultLayerProps[] = [];
334334

@@ -346,7 +346,10 @@ export default class PointLayer extends Layer {
346346
isVisible?: boolean;
347347
columns?: PointLayerColumnsConfig;
348348
} = {
349-
label: pair.defaultName || 'Point'
349+
label:
350+
pair.defaultName ||
351+
(typeof label === 'string' && label.replace(/\.[^/.]+$/, '')) ||
352+
'Point'
350353
};
351354

352355
// default layer color for begintrip and dropoff point

0 commit comments

Comments
 (0)