angular-google-places-autocomplete
angular-google-places-autocomplete copied to clipboard
Exclude extra data requests to google api
Hi! I use this library and encountered a problem.
It is my bill from google:
How can I exclude Contact Data, Atmosphere Data, Places Details from requests?
Hi @Bendor, I have exactly the same problem as you ! Have you found a solution?
This can be fixed by setting geocode option as follow.
$scope.autocompleteOptions = { types: ['geocode'] }
On your input field set the option;
g-places-autocomplete options="autocompleteOptions"
This will only result geocoded results ;)
{ "address_components": [ { "long_name": "Stationsplein", "short_name": "Stationsplein", "types": [ "route" ] }, { "long_name": "Amsterdam-Centrum", "short_name": "Amsterdam-Centrum", "types": [ "sublocality_level_1", "sublocality", "political" ] }, { "long_name": "Amsterdam", "short_name": "Amsterdam", "types": [ "locality", "political" ] }, { "long_name": "Amsterdam", "short_name": "Amsterdam", "types": [ "administrative_area_level_2", "political" ] }, { "long_name": "Noord-Holland", "short_name": "NH", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "Nederland", "short_name": "NL", "types": [ "country", "political" ] }, { "long_name": "1012", "short_name": "1012", "types": [ "postal_code_prefix", "postal_code" ] } ], "adr_address": "<span class="street-address">Stationsplein, <span class="postal-code">1012 <span class="locality">Amsterdam, <span class="country-name">Nederland", "formatted_address": "Stationsplein, 1012 Amsterdam, Nederland", "geometry": { "location": { "lat": 52.3786982, "lng": 4.898970200000008 }, "viewport": { "south": 52.37553809999994, "west": 4.892571699999962, "north": 52.38274130000005, "east": 4.906784099999982 } }, "icon": "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png", "id": "40585de16f46e277829823122fd0fe91e97115ef", "name": "Stationsplein", "place_id": "EipTdGF0aW9uc3BsZWluLCAxMDEyIEFtc3RlcmRhbSwgTmV0aGVybGFuZHMiLiosChQKEglZ9CiitwnGRxF3Vh-FVlg3axIUChIJVXealLU_xkcRja_At0z9AGY", "reference": "EipTdGF0aW9uc3BsZWluLCAxMDEyIEFtc3RlcmRhbSwgTmV0aGVybGFuZHMiLiosChQKEglZ9CiitwnGRxF3Vh-FVlg3axIUChIJVXealLU_xkcRja_At0z9AGY", "scope": "GOOGLE", "types": [ "route" ], "url": "https://maps.google.com/?q=Stationsplein,+1012+Amsterdam,+Nederland&ftid=0x47c609b7a228f459:0x6b375856851f5677", "utc_offset": 120, "vicinity": "Amsterdam-Centrum", "html_attributions": [] }