angular-google-places-autocomplete icon indicating copy to clipboard operation
angular-google-places-autocomplete copied to clipboard

Exclude extra data requests to google api

Open Bendor opened this issue 6 years ago • 2 comments

Hi! I use this library and encountered a problem. It is my bill from google: image

How can I exclude Contact Data, Atmosphere Data, Places Details from requests?

Bendor avatar Dec 11 '18 15:12 Bendor

Hi @Bendor, I have exactly the same problem as you ! Have you found a solution?

gl3n avatar Mar 02 '19 19:03 gl3n

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": [] }

kufhjer avatar May 28 '19 11:05 kufhjer