Skip to content

Ticket 8: Fetch and Draw the Real Google Route #14

@matbbiji

Description

@matbbiji

Now that we have the exact GPS coordinates from the Search Box, we need to send them to the Backend. The Backend will ping Google's API, get a real path, assign a temporary/dummy safety score to it (since our ML isn't done yet), and send it back to us. Your job is to take that response, draw the route on the Map Screen, and update the Stats / Metric info associated with the route.

Resources:

Read the React Native fetch() API documentation (or use axios if you prefer).

Read the react-native-maps documentation specifically for the component.

Definition of Done:

[ ] The app successfully sends a POST request to the backend's /api/route endpoint containing the start_coords and end_coords JSON.

[ ] The Localhost Trap: The fetch URL uses the backend developer's actual Wi-Fi IP address (e.g., http://192.168.1.55:8000), NOT localhost.

[ ] The UI displays a "Loading" state while waiting for the backend to respond.

[ ] Upon receiving the response, the app parses the route_coordinates array and successfully draws a on the Map Screen.

[ ] The Route Details bottom sheet updates to display the overall_safety_risk (which will be a dummy number for now) and eta_minutes provided by the backend.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions