leaflet-blurred-location
leaflet-blurred-location copied to clipboard
Optimize to address exceeded rate limit while geocoding
On PublicLab.org it seems to be making thousands of calls, very quickly; running through the API rate limit. Try it on https://publiclab.org/micro for example!
These 2 listeners are calling the Google Geocoding API :
1.) Called when we select from the autocomplete list : https://github.com/publiclab/leaflet-blurred-location/blob/7ca8da726a6818fa0926a5612a72af9d96e2e1d5/src/core/Geocoding.js#L65
2.) Called when Enter key is pressed : https://github.com/publiclab/leaflet-blurred-location/blob/7ca8da726a6818fa0926a5612a72af9d96e2e1d5/src/core/Geocoding.js#L72
I have tested both listeners , they are called at the same time and only when ENTER (13) key is pressed ! So for one search - 2 calls are going to API . We can do this optimization to call only 1 time , will do this as soon as we solve #161 .
Thanks !
Resolving in #214 with a paid-for API key limited to PL domains!
However, if we want to re-open for optimization, we can rename this and keep it open! Let's do that!