|
|
@ -1,13 +1,13 @@
|
|
|
|
import { BackgroundImage } from '@rneui/base';
|
|
|
|
import { BackgroundImage } from '@rneui/base';
|
|
|
|
import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
|
|
import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
|
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
|
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
|
|
import MapView, { Polyline } from 'react-native-maps';
|
|
|
|
import MapView, { Marker, Polyline } from 'react-native-maps';
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import { Lap as LapModel} from '../core/Lap';
|
|
|
|
import { Lap as LapModel} from '../core/Lap';
|
|
|
|
import TopBar from '../components/TopBar';
|
|
|
|
import TopBar from '../components/TopBar';
|
|
|
|
import { Point } from '../core/Point';
|
|
|
|
import { Point } from '../core/Point';
|
|
|
|
|
|
|
|
|
|
|
|
export default function Lap(props: { navigation: any, route }) {
|
|
|
|
export default function Lap(props: { navigation: any, route : any}) {
|
|
|
|
const { currentLap } = props.route.params;
|
|
|
|
const { currentLap } = props.route.params;
|
|
|
|
const { navigation } = props;
|
|
|
|
const { navigation } = props;
|
|
|
|
|
|
|
|
|
|
|
@ -30,6 +30,18 @@ export default function Lap(props: { navigation: any, route }) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const markers: { id: number; name: string; coordinate: { latitude: number; longitude: number } }[] = points.map((pt, index) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
id: index,
|
|
|
|
|
|
|
|
name: pt.getDistance() + 'm',
|
|
|
|
|
|
|
|
coordinate: { latitude: pt.getGeo().getGpsLat(), longitude: pt.getGeo().getGpsLong() },
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleMarker = (index : number) => {
|
|
|
|
|
|
|
|
setCurrentPointIndex(index);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// currentLap.getPoints().forEach(pt => {
|
|
|
|
// currentLap.getPoints().forEach(pt => {
|
|
|
|
// points.push({ latitude: pt.getGeo().getGpsLat(), longitude: pt.getGeo().getGpsLong() });
|
|
|
|
// points.push({ latitude: pt.getGeo().getGpsLat(), longitude: pt.getGeo().getGpsLong() });
|
|
|
|
|
|
|
|
|
|
|
@ -73,13 +85,10 @@ export default function Lap(props: { navigation: any, route }) {
|
|
|
|
longitudeDelta: 0.015,
|
|
|
|
longitudeDelta: 0.015,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{/* <Marker
|
|
|
|
{markers.map(({ id, name, coordinate }) => (
|
|
|
|
coordinate={{
|
|
|
|
<Marker key={id} title={name} coordinate={coordinate} onPress={() => handleMarker(id)} />
|
|
|
|
latitude: 45.76013484856403,
|
|
|
|
))}
|
|
|
|
longitude: 3.112214188782891,
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
onPress={() => console.log('pressed')}
|
|
|
|
|
|
|
|
/> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</MapView>
|
|
|
|
</MapView>
|
|
|
|
<ScrollView style={ styles.scrollView}>
|
|
|
|
<ScrollView style={ styles.scrollView}>
|
|
|
|