Friday, March 18, 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(function() {  
 //put auto-complete calls in here  
 }, 250);  
 }  

So every time a user starts typing in the input the autocomplete will not fire until there is a momentary delay. The delay of 250ms can be reduced to make the autocomplete fire more often. If the user quickly types "Toronto", only one auto-complete call will be executed instead of 8 when the user hesitates.

We find the timed delay works the best. A critical point to this is to make sure that the user interface indicates that a search is going on as they are typing. In our case we use an animated spinner. This way if the user is typing quickly and not seeing results, the animated spinner will give them enough pause to see the results.

It should be noted that implementing this is compliant with their current terms of use. All this method essentially does is throttle the amount of out bound autocomplete calls from the user.

22 comments:

  1. I have never known Scribble Map up until now. I only use Google Map. This is great! We would have an alternative way in finding places.

    ReplyDelete
  2. Thanks for such a great information and to provide us. We have the finest I mcafee certified technicians and If you're facing trouble in your mcafee antivirus software then just go through the link here. Click Here:- http://mcafeetechsupport.com/

    ReplyDelete
  3. We have our Hotmail account technical service support experts equipped with the latest tools and Hotmail services to analyze your questions, grasp them instantly and sort your Hotmail account problems even quicker.

    ReplyDelete
  4. Gmail users can easily obtain the great technical assistance at the time of forgetting security questions for account recovery related issues. In case you have forgotten security queries, you can take Gmail account support by dialing a Gmail customer service 1-800 toll free phone number.

    ReplyDelete
  5. Find it good enough and here is one more think people should know its the latest Gmail customer support Toll-free number which is helping till your problem not solve.

    ReplyDelete
  6. If you can consult a team of third party Gmail customer support providing company for obtaining the bulk number of issues in a right manner. Just depend on the Gmail tech support expert today to obtain the utmost solutions. Here your every issue will be sorted out instantly.

    ReplyDelete
  7. You can to talk about your difficulty with your family and friend member who may be using the similar email service. May be they have faced comparable issue before and can share with you their ways of decision. You can also check some other online Yahoo mail customer service care that is available in the form of blogs and forums.


    ReplyDelete
  8. Find The Best Yahoo Helpline Number

    It can be resolved any issues by Yahoo helpline number. Getting technical assistance for all issues of Yahoo is easy, with easily available support solution from Yahoo team. Yahoo is a web service so any issues create a Yahoo account to get the solution and dial a toll free Yahoo phone number. Yahoo team support for managing emails and other folder so on.

    ReplyDelete
  9. Find the Yahoo Mail Bounce Messages on Correct Emails

    Is your Yahoo Mail getting bounced? Check the recipient’s address carefully. Ask the recipient to check whether they have blocked your email address by mistake. Ensure JAVA script is enabled in your browser. Delete the cookies, cache and the entire browsing history and try again. If somehow you are using any third party email client and you are disrupting the DMARC policy of Yahoo then you won’t be able to send an email successfully. In that case, contact our certified Yahoo Customer Service toll-free number for the complete solution related to Yahoo account.

    ReplyDelete
  10. The Yahoo account recovery helpline number
    can be right of entry both from mobile and landline numbers. Yahoo users can acquire in stroke with the technical assist team of Yahoo at any time they need.

    ReplyDelete
  11. There are three ways to create a backup file of your Yahoo account data. You can print the hard copies of the data. Secondly, you can forward a particular email from Yahoo account to some other existing email account. Last but not the least, you can configure Yahoo account with POP3 access and download the entire data in the form of a .pst file and dial a Yahoo contact phone number and get the best way to create a backup file of Yahoo mail account.

    ReplyDelete
  12. The technical assist of Yahoo team provides possible best solutions for your account problems after ensuring that the solutions are totally capable of resolving your concern. The best way to get result simply is by call the Yahoo contact phone number and get in touch with the technical associates of Yahoo.

    ReplyDelete
  13. Nice article written by Scribble Maps, thanks for sharing this graceful blog post, i just check this link and its take me to the yahoo customer service phone number 2017 and now I'm totally satisfied.

    ReplyDelete
  14. How to Attach Image While Emailing With Yahoo Problems

    If you are getting specific issues and thinking to report it to Yahoo then you might have to share some screenshot or image in regards to the same. You can’t contact Yahoo over the phone as they don’t have any contact centre for the individuals. If you are on a desktop then press the PrtSc Key along with the Fn key if applicable and save the screenshot either to MS-Paint or MS-Word.To contact us, feel free to give us a call on our Yahoo mail helpline toll free number,get the best solution for Yahoo problems .

    ReplyDelete
  15. Yahoo mail forgot password online number
    is a one-stop clarification for wide diversity of Yahoo related all problems and if you have forgotten your account password and do not know how to get well it, you must get in touch with technical associates and access the best feasible remedies.

    ReplyDelete
  16. Roadrunner customer service number is the best point to contact when you stuck with the issue in Roadrunner. The number is reliable and it is always accessible from any location. Also, when you contact the support team number then it is not like your call will be in waiting list for longer time. On the contrary it gets connected easily and you will get prompt response for all your queries. Roadrunner customer service care helpline team
    is the best in providing solution to any problem and it can be reached to you anytime and from any location. All that a user needs to do is to call at the suggested contact number.

    ReplyDelete
  17. Thanks for such a great information and to provide us. We have the finest certified technicians and If you're facing trouble in your McAfee Antivirus software then just go through the link here. Click Here:- https://www.linkedin.com/company/mcafee-antivirus-toll-free-number

    ReplyDelete
  18. How to Change Of Yahoo Email Password for Recovery Account

    Follow these steps and change your Yahoo email password instantly:
     On your Yahoo app, you need to tap the Menu icon.
     After that click Manage Accounts.
     Then you need to tap Account info.
     Later on tap Security settings.
     And enter the security code.
     Now, tap Change password.
     You need to click I would rather change my password.
     Finally, enter the new password, its confirmation and click Continue.

    These instructions will solve the purpose of changing your Yahoo forgot password in a quick span of time.

    ReplyDelete
  19. 24x7 QuickBooks support phone number Phone Help Number@ +1-800-272-4167: QuickBooks Errors, QuickBooks Backup, QuickBooks Software Install & Update, QuickBooks Drivers, QuickBooks Sage 50 Converson, QuickBooks Printer Issues, Troubleshoot & Fix QuickBooks.

    ReplyDelete