vue-google-maps icon indicating copy to clipboard operation
vue-google-maps copied to clipboard

Place Autocomplete Debounce

Open vdiaza opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Google maps autocomplete becomes very expensive on a large scale, this is due that it performs a request each time a key is pressed.

Describe the solution you'd like Best way to avoid sending too many requests is to add a debounce feature to wait x ms before sending a new request..

vdiaza avatar Sep 26 '23 22:09 vdiaza

Maybe something like lodash‘s debounce function could do the trick on the change event handler.

wavedeck avatar Jan 12 '24 11:01 wavedeck

@wavedeck what do you mean add a debounce function on the change event handler? Are you talking about adding it to the place_changed event? If that's the case, that event is only fired when a user actually selects an item from the drop down, not when a key stroke is pressed.

Having said that, I think the way google bills is per "session", in which a session includes the autocomplete suggestions with a final getplacedetails call. So the billing issue might not be that big of a problem.

chronicadventure avatar Feb 05 '24 22:02 chronicadventure