Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fill address fields using reverseGeocode function #99

Open
abishekrsrikaanth opened this issue Apr 26, 2024 · 0 comments
Open

Cannot fill address fields using reverseGeocode function #99

abishekrsrikaanth opened this issue Apr 26, 2024 · 0 comments

Comments

@abishekrsrikaanth
Copy link

abishekrsrikaanth commented Apr 26, 2024

I have the address_1 and address_2 fields on my form and I want to fill the address_2 field, but I can't seem to find the correct field name for the rest of the address here https://github.com/cheesegrits/filament-google-maps?tab=readme-ov-file#reverse-geocoding. How do I go about doing this? Anyway to get these fields here https://developers.google.com/maps/documentation/javascript/supported_types#table2

Here is the code I have

Geocomplete::make('address_1')
      ->reverseGeocode([
          'address_1' => '%n %S',
          'address_2' => '%a1 %a2 %a3 %a4 %L %p',
          'zip' => '%z',
      ])
      ->countries(fn () => [Filament::getTenant()->location->country->iso_3166_2])
      ->lazy(),

CleanShot 2024-04-26 at 16 54 40

Also, is there a way to set the latitude and longitude fields on the afterStateUpdated method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant