cheesegrits / filament-google-maps

Google Maps package for Filament PHP
234 stars 65 forks source link

Added minimum characters for autocompletion for cost optimization #111

Open Heyian opened 3 months ago

Heyian commented 3 months ago

On the Geocomplete field, I've added the option minChars() to be able to set a number of minimum characters before it starts autocompleting. I've also added a 300ms debouce time so it doesn't start polling the API while typing, this reduces significantly the cost. There's is a default value of 0 for the minChars so the option is optional and the default function work as it as before.

I've moved the geocompleteEl and geocomplete constant declarations up so there wasn't any deduplication.

I've also edited the Readme to reflect the changes and document the cost optimization.

Heyian commented 1 month ago

Hey there. I've merged this PR onto my fork so we can all get all these goodies from a single place. I gave credits to the person who made the PR in the commits, changelog and in the releases. I've also credited cheesegrits for his work on the repo and made it clear this was a fork on top of the Readme. I'm not trying to hijack anything, I just want to be able to use all the good solutions people put in the pull requests and I thought I'd made this available to all. If you're interested in this version or want to contribute, you can find my fork at : Heyian/forkMain

I'm open to suggestions on how to move forward from here, simply open up an issue in my fork so we can chat about it. Thanks.