react-places-autocomplete icon indicating copy to clipboard operation
react-places-autocomplete copied to clipboard

Reduce Api Calls

Open MiltonAkash opened this issue 7 years ago • 7 comments

Google autocomplete gives us placeId, Latitude &Longitude on selecting the suggestion itself. But in this package we are manually making another call to geocode the address.

MiltonAkash avatar Feb 19 '18 19:02 MiltonAkash

There is a placeId passed back in the onSelect handler, but I don't see long/lats anywhere in the suggestion object though. Are you able to point out where/when you get it during auto complete?

daan-nguyen avatar Apr 26 '18 09:04 daan-nguyen

+1 Google has kicked in with new billing policy, this one becomes pricy now :)

IngusSkaistkalns avatar Aug 02 '18 11:08 IngusSkaistkalns

@hibiken Hello! Any updates on that? ) Or it's working now only on bought acc in Google, not for free? (demo works fine)

abobykin avatar Jun 03 '19 10:06 abobykin

i completely agree, it is making api call twice for geocoding, whereas place api does the geocoding implicitly now ..

m-nathani avatar Apr 28 '20 11:04 m-nathani

ill try to create a fix and send PR if its works..

m-nathani avatar Apr 28 '20 15:04 m-nathani

@m-nathani Can you elaborate? Which request is it doing twice and how could this be solved?

sambokai avatar May 17 '20 09:05 sambokai

based on googles documentation to group requests, you need to specify a session_id, so it groups up the calls

stephanelpaul avatar May 31 '20 18:05 stephanelpaul