Here in this form I have used business locations
Now in this business locations , there are multiple business locations based on how many are stored in backend
here I want if I select any business location then it will check in backend that this location latitude and longitude is in backend or not if its not in backend then it should open a google autocomplete where user can select their location so we can acheive latitude and longitude
So change the design of this business location so I can select multiple locations as well as it will check if latitude and logitude is in backend or not for particular location and not then it should open google autocompplete
I'll create a multi-select business location component that checks for coordinates in the backend and opens Google Places Autocomplete when needed.
I've created a multi-select business location component that:
YOUR_GOOGLE_MAPS_API_KEY
in the layout file with your actual Google Maps API keyfetchLocationsFromBackend
function is a mock - replace it with your actual API callI'll convert the business location selector to use React MUI with TypeScript:
I've converted the business location selector to use Material UI (MUI) components with TypeScript. Here's what changed:
The core functionality remains the same:
Added visual indicators for locations without coordinates:
YOUR_GOOGLE_MAPS_API_KEY
in the layout file with your actual Google Maps API keyfetchLocationsFromBackend
function is still a mock - replace it with your actual API call