Skip to content

Commit

Permalink
[Bug] fix trip layer timestamp check (#1904)
Browse files Browse the repository at this point in the history
Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
jwasilgeo committed Aug 4, 2022
1 parent cb76ae0 commit 39427d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/layers/src/trip-layer/trip-layer.ts
Expand Up @@ -339,7 +339,7 @@ export default class TripLayer extends Layer {
new DeckGLTripsLayer({
...defaultLayerProps,
...data,
getTimestamps: d => data.getTimestamps(d).map(ts => ts - domain0),
getTimestamps: d => (data.getTimestamps(d) || []).map(ts => ts - domain0),
widthScale: this.config.visConfig.thickness * zoomFactor * zoomFactorValue,
rounded: true,
wrapLongitude: false,
Expand Down
5 changes: 4 additions & 1 deletion src/layers/src/trip-layer/trip-utils.ts
Expand Up @@ -35,7 +35,10 @@ import {DataContainerInterface} from 'utils/table-utils/data-container-interface
export function coordHasLength4(samples): boolean {
let hasLength4 = true;
for (let i = 0; i < samples.length; i += 1) {
hasLength4 = !samples[i].geometry.coordinates.find(c => c.length < 4);
hasLength4 =
Array.isArray(samples[i]?.geometry?.coordinates) &&
!samples[i].geometry.coordinates.find(c => c.length < 4);

if (!hasLength4) {
break;
}
Expand Down

0 comments on commit 39427d4

Please sign in to comment.