Bug fix
This commit is contained in:
parent
1f2979b28b
commit
f9a44b3b70
|
@ -16,14 +16,18 @@ const TrksegViewer: Component<Props> = ({ trksegId }) => {
|
||||||
|
|
||||||
const trkseg = peekCachedSignal({ id: trksegId, action: 'getTrkseg' });
|
const trkseg = peekCachedSignal({ id: trksegId, action: 'getTrkseg' });
|
||||||
console.log({ caller: 'TrksegViewer', trksegId, trkseg: trkseg() });
|
console.log({ caller: 'TrksegViewer', trksegId, trkseg: trkseg() });
|
||||||
const title = () => {
|
|
||||||
return trkseg().name;
|
|
||||||
};
|
|
||||||
|
|
||||||
const lineString = new LineString(
|
const lineString = new LineString(
|
||||||
trkseg().trkpt.map((trkpt: any) => [trkpt.$.lon, trkpt.$.lat])
|
trkseg().trkpt.map((trkpt: any) => [trkpt.$.lon, trkpt.$.lat])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const firstTrkpt = () => trkseg().trkpt.at(0);
|
||||||
|
const lastTrkpt = () => trkseg().trkpt.at(-1);
|
||||||
|
|
||||||
|
const title = () => {
|
||||||
|
return firstTrkpt().time;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tree
|
<Tree
|
||||||
title={
|
title={
|
||||||
|
@ -36,13 +40,13 @@ const TrksegViewer: Component<Props> = ({ trksegId }) => {
|
||||||
<div>
|
<div>
|
||||||
{getFormatedLength(lineString)} {t('from')}{' '}
|
{getFormatedLength(lineString)} {t('from')}{' '}
|
||||||
<DisplayOrGetAddress
|
<DisplayOrGetAddress
|
||||||
target={() => trkseg().trkpt.at(0)}
|
target={firstTrkpt}
|
||||||
putAction='putTrkpt'
|
putAction='putTrkpt'
|
||||||
putParamName='trkpt'
|
putParamName='trkpt'
|
||||||
/>{' '}
|
/>{' '}
|
||||||
{t('to')}{' '}
|
{t('to')}{' '}
|
||||||
<DisplayOrGetAddress
|
<DisplayOrGetAddress
|
||||||
target={() => trkseg().trkpt.at(-1)}
|
target={lastTrkpt}
|
||||||
putAction='putTrkpt'
|
putAction='putTrkpt'
|
||||||
putParamName='trkpt'
|
putParamName='trkpt'
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue