google-map icon indicating copy to clipboard operation
google-map copied to clipboard

How to prevent OVER_QUERY_LIMIT with google-map-search and input

Open ammopt opened this issue 8 years ago • 1 comments

Hello. I'm trying Polymer for the first time and developing a simple view like so:

<paper-input value="{{input}}"></paper-input> <google-map-search map="{{map}}" query="{{input}}" results="{{results}}"></google-map-search> .....

It kind of works: the map updates the markers based on the results from the input typed in the paper-input element. However, if I type too fast, I noticed the error on the console: Cannot read property 'map' of null

After a while I found out it's returning OVER_QUERY_LIMIT status from Places Service. Is there a correct way to prevent this? Thanks!

ammopt avatar Aug 25 '17 10:08 ammopt

Have you tried getAddress from https://stackoverflow.com/a/11825245/3915432? It delays your sending query to Google to prevent reaching the query limits.

chenster avatar Aug 28 '17 07:08 chenster