import { Overlay, MapState, Point } from 'pigeon-maps'; import React from 'react'; const GPXOverlay: React.FC<{ mapState: any; latLngToPixel: any; track: any; }> = (props: { mapState: MapState; latLngToPixel: | (( latLng: Point, center?: Point | undefined, zoom?: number | undefined ) => Point) | undefined; track: any; }) => { const trkToPolyline = (trk: any) => { const latLongs: string[] = trk.trkseg[0].trkpt.map((trkpt: any) => { if (props.latLngToPixel === undefined) { return ''; } const point: Point = [trkpt['$'].lat, trkpt['$'].lon]; const pixelPoint = props.latLngToPixel(point); if (pixelPoint === undefined) { return ''; } return pixelPoint.join(' '); }); console.log('latLongs: ' + latLongs); return latLongs.join(' '); }; return ( {props.mapState.width > 0 && ( )} ); }; export default GPXOverlay;