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

Added latLng Attributes functionality to Geocomplete #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eugenpasca
Copy link

@eugenpasca eugenpasca commented Oct 9, 2023

This PR introduces an enhancement that allows users to effectively override the model's getLatLngAttributes() method. This improvement caters to scenarios where a form or model contains multiple Geocomplete fields, each of which requires conversion to distinct latitude and longitude fields.

Key Features:

  1. Ability to define separate latitude and longitude fields for each Geocomplete input.
  2. Provides flexibility to structure and manage multiple Geocomplete fields within a single model or form.

Example Code Snippet

  RogGeocomplete::make('from_address')
      ->live()
      ->columnSpanFull()
      ->updateLatLng()
      ->latLngAttributes([
          'lat' => 'from_lat',
          'lng' => 'from_lng',
      ]),
  TextInput::make('from_lat'),
  TextInput::make('from_lng'),
  
  
  RogGeocomplete::make('to_address')
      ->live()
      ->columnSpanFull()
      ->updateLatLng()
      ->latLngAttributes([
          'lat' => 'to_lat',
          'lng' => 'to_lng',
      ]),
  TextInput::make('to_lat'),
  TextInput::make('to_lng'),

@cheesegrits
Copy link
Owner

@eugenpasca can you update the README to document / give an example of this, then I'll merge it.

@cheesegrits
Copy link
Owner

@eugenpasca any chance you can respond to my previous msg?

@abishekrsrikaanth
Copy link

Would love for this to be merged if the functionality works.

@eugenpasca
Copy link
Author

Hello, sorry for not responding to this.
@cheesegrits , I will take care of the documentation this week so you can merge it.

@cheesegrits
Copy link
Owner

@eugenpasca still no README update.

I'll leave this open for a little while longer, then close it if the README isn't updated.

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

Successfully merging this pull request may close these issues.

3 participants