This commit is contained in:
parent
d8cad992d8
commit
d85f5d3f95
|
@ -6,7 +6,6 @@ import { lat2tile, lon2tile } from '../../lib/geo';
|
||||||
import { zoom0 } from '../../store/map';
|
import { zoom0 } from '../../store/map';
|
||||||
|
|
||||||
const Gpx: React.FC<{ gpx: any }> = (props) => {
|
const Gpx: React.FC<{ gpx: any }> = (props) => {
|
||||||
|
|
||||||
var trkpts: any[] = [];
|
var trkpts: any[] = [];
|
||||||
|
|
||||||
trkpts = useFind({
|
trkpts = useFind({
|
||||||
|
@ -18,14 +17,19 @@ const Gpx: React.FC<{ gpx: any }> = (props) => {
|
||||||
// use_index: 'type-trkpt-gpx-time3',
|
// use_index: 'type-trkpt-gpx-time3',
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`rendering gpx, subtype:"${props.gpx.subtype}", ${trkpts.length} points`);
|
console.log(
|
||||||
|
`rendering gpx, subtype:"${props.gpx.subtype}", ${trkpts.length} points`
|
||||||
|
);
|
||||||
|
|
||||||
trkpts.sort((first: any, second: any) =>
|
trkpts.sort((first: any, second: any) =>
|
||||||
first.trkpt.time.localeCompare(second.trkpt.time)
|
first.trkpt.time.localeCompare(second.trkpt.time)
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log(`gpx: ${JSON.stringify(props.gpx)}`);
|
const clickHandler = (event: any) => {
|
||||||
|
console.log(`gpx (${JSON.stringify(props.gpx)}) clicked.`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// console.log(`gpx: ${JSON.stringify(props.gpx)}`);
|
||||||
|
|
||||||
const d = trkpts.reduce((previous: string, current: any, index: number) => {
|
const d = trkpts.reduce((previous: string, current: any, index: number) => {
|
||||||
const action = index === 0 ? 'M' : index === 1 ? 'L' : '';
|
const action = index === 0 ? 'M' : index === 1 ? 'L' : '';
|
||||||
|
@ -36,7 +40,13 @@ const Gpx: React.FC<{ gpx: any }> = (props) => {
|
||||||
)}`;
|
)}`;
|
||||||
}, '');
|
}, '');
|
||||||
|
|
||||||
return <path d={d} className={`track ${props.gpx.subtype}`} />;
|
return (
|
||||||
|
<path
|
||||||
|
d={d}
|
||||||
|
className={`track ${props.gpx.subtype}`}
|
||||||
|
onClick={clickHandler}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Gpx;
|
export default Gpx;
|
||||||
|
|
|
@ -40,6 +40,7 @@ const TrackBrowser: React.FC<{}> = () => {
|
||||||
</IonButton>
|
</IonButton>
|
||||||
<IonModal
|
<IonModal
|
||||||
ref={modal}
|
ref={modal}
|
||||||
|
className='full-height'
|
||||||
trigger='track-browser-button'
|
trigger='track-browser-button'
|
||||||
enterAnimation={enterAnimation}
|
enterAnimation={enterAnimation}
|
||||||
leaveAnimation={leaveAnimation}
|
leaveAnimation={leaveAnimation}
|
||||||
|
|
|
@ -50,6 +50,10 @@ ion-modal {
|
||||||
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ion-modal.full-height {
|
||||||
|
--height: 99%;
|
||||||
|
}
|
||||||
|
|
||||||
/* ion-modal::part(backdrop) {
|
/* ion-modal::part(backdrop) {
|
||||||
background: rgba(209, 213, 219);
|
background: rgba(209, 213, 219);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
Loading…
Reference in New Issue