Posts

Showing posts from March, 2016

Developers: Saving Google API Credits with Autocomplete

There are a lot of winners with Google's new API pricing. However, if your app is using the whole suite of mapping functionality and you have a lot of users you might find your pool will start declining fast. Two functions that will draw directly on your pool and are not subject to the daily free quota is autocomplete and place search. If you use your Google licence with the Scribble Maps API we do some of these optimizations out of the box, but if you are building your own custom implementation directly on top of the Google Maps API, there is a simple update you can do to save you some autocomplete credits. The standard auto-complete functionality will send out an auto-complete request with every change in the input. It's possible to cut the amount of credits used significantly by putting in a timeout when the input changes. Here is a very basic example. var acTimeOut; textSearchInput.onkeyup = function() { clearTimeout(acTimeout); acTimeout = setTimeout(func