Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 57 additions & 60 deletions mobile-app/app/(tabs)/maps.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,76 +72,73 @@ export default function MapsScreen() {
}
}, [currentLocation]);

if (isLoading) {
return <ActivityIndicator />;
}

return (
<View style={styles.container}>
<MapView ref={mapRef} style={styles.map} initialRegion={initialRegion}>
{/* OpenStreetMap tile layer */}
<UrlTile
urlTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png"
maximumZ={19}
minimumZ={1}
/>
<View className="flex-1 min-h-full flex items-center justify-center">
{isLoading ? (
<ActivityIndicator />
) : (
<MapView ref={mapRef} style={styles.map} initialRegion={initialRegion}>
{/* OpenStreetMap tile layer */}
<UrlTile
urlTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png"
maximumZ={19}
minimumZ={1}
/>

{/* Current location marker - only show if location is available */}
{currentLocation && (
<Marker
coordinate={{
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
}}
title="現在地"
description="Your current location"
pinColor="orange"
/>
)}

{/* Current location marker - only show if location is available */}
{currentLocation && (
{/* Markers for each location */}
<Marker
coordinate={{
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
}}
title="現在地"
description="Your current location"
pinColor="orange"
coordinate={tokyoTower}
title="Tokyo Tower"
description="Starting point"
pinColor="green"
/>
<Marker
coordinate={convenienceStore1}
title="Convenience Store 1"
description="First stop"
pinColor="blue"
/>
<Marker
coordinate={convenienceStore2}
title="Convenience Store 2"
description="Second stop"
pinColor="blue"
/>
<Marker
coordinate={tokyoSkytree}
title="Tokyo Skytree"
description="Final destination"
pinColor="red"
/>
)}

{/* Markers for each location */}
<Marker
coordinate={tokyoTower}
title="Tokyo Tower"
description="Starting point"
pinColor="green"
/>
<Marker
coordinate={convenienceStore1}
title="Convenience Store 1"
description="First stop"
pinColor="blue"
/>
<Marker
coordinate={convenienceStore2}
title="Convenience Store 2"
description="Second stop"
pinColor="blue"
/>
<Marker
coordinate={tokyoSkytree}
title="Tokyo Skytree"
description="Final destination"
pinColor="red"
/>

{/* Route polyline */}
<Polyline
coordinates={routeCoordinates}
strokeColor="#FF6B6B"
strokeWidth={3}
lineCap="round"
lineJoin="round"
/>
</MapView>
{/* Route polyline */}
<Polyline
coordinates={routeCoordinates}
strokeColor="#FF6B6B"
strokeWidth={3}
lineCap="round"
lineJoin="round"
/>
</MapView>
)}
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
},
map: {
width: Dimensions.get("window").width,
height: Dimensions.get("window").height,
Expand Down
Loading