Open jaradehr1 opened 3 years ago
It would be great to know if this is an issue with this plugin. If we could all safe some money I'd also be ready to do a PR :-)
https://developers.google.com/maps/documentation/javascript/places-autocomplete
It seems that sessionToken is only used with the getPlacePredictions
and not getPlace
that is used in this project.
Some more insight on this. Since this plugin uses an Autocomplete widget, session tokens are automatically handled in the background. Please refer to this link. https://developers.google.com/maps/documentation/javascript/places-autocomplete#session_tokens
Some more insight on this. Since this plugin uses an Autocomplete widget, session tokens are automatically handled in the background. Please refer to this link. https://developers.google.com/maps/documentation/javascript/places-autocomplete#session_tokens
Correct, they are automatically handled. However, the autocomplete widget does not give you control over how to use that session which leads to a higher bill.
If I can get your input on this guys:
Some more insight on this. Since this plugin uses an Autocomplete widget, session tokens are automatically handled in the background. Please refer to this link. https://developers.google.com/maps/documentation/javascript/places-autocomplete#session_tokens
Correct, they are automatically handled. However, the autocomplete widget does not give you control over how to use that session which leads to a higher bill.
Indeed. Though, I wonder, do we need that control?
If you test the widget and have a look at the Network tab, you'll see that AutocompletionService.GetPredictions
method is fired together with a query that has a parameter&20s
. Right after this comes a token, which is reused in all other GetPredictions
requests until you fire a GetPlaceDetails
by choosing a place. I checked this several times and it was a relief to know that.
Some more insight on this. Since this plugin uses an Autocomplete widget, session tokens are automatically handled in the background. Please refer to this link. https://developers.google.com/maps/documentation/javascript/places-autocomplete#session_tokens
Correct, they are automatically handled. However, the autocomplete widget does not give you control over how to use that session which leads to a higher bill.
Indeed. Though, I wonder, do we need that control? If you test the widget and have a look at the Network tab, you'll see that
AutocompletionService.GetPredictions
method is fired together with a query that has a parameter&20s
. Right after this comes a token, which is reused in all otherGetPredictions
requests until you fire aGetPlaceDetails
by choosing a place. I checked this several times and it was a relief to know that.
hmm.. I think I read in the documentation that every key stroke is considered an api call with (different session token). That is what the implementation of Autocomplete widget that uses getPlace function.. with get predication, you get to choose to use the same token over and over with every key stroke until the user selects a place. Correct me if I am wrong.
The Per Request is the default billing option when you use AutocompleteService(). Charges are applied per keystroke, that could lead to higher billings. I am trying to use Session Tokens when implementing AutocompleteService.getPlacePredictions() to group together autocomplete requests for billing purposes.
Session tokens group the query and selection phases of a user autocomplete search into a discrete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place. Each session can have multiple queries, followed by one place selection.
Please see the JS code
The
handleAddressChange(address: Address)
fires on selection, but there is no other event that fires per keystrokeAny help how to do this in my Angular 8? Please, refer to my stackoverflow question