flowchart TD
A[Location Input] --> B[Autocomplete API]
B --> C[Search Results]
C --> D[Pick First Result]
D --> E[Extract State & Place ID]
E --> F[Geocoding API with Place ID]
F --> G[Return Lat, Long & State]
E --> G
style A fill:#e1f5fe
style G fill:#c8e6c9
style B fill:#fff3e0
style F fill:#fff3e0
- Location Input: User provides a location string
- Autocomplete API: Sends the location to autocomplete service
- Search Results: API returns list of matching locations
- Pick First Result: Select the first (most relevant) result from the list
- Extract State & Place ID: Extract the state information and place ID from the selected result
- Geocoding API: Use the place ID to call the geocoding API
- Return Lat, Long & State: Return the latitude, longitude coordinates and state information