0

With the help of this great website I have been able to get about 92% of what I need, but I just can't get over the hump on this thing. I made a map that geocodes multiple points and draws a line between them, but I just can't get it to map the last point. I don't know if there is a limit on something at 11 points or what. The script I have is at http://www.maptest.freehosting.com/chi.html. I built this out so I could add up to address 11, but when I try to add 12 (which happens to be my final point frustratingly enough) it won't work. Am I doing something totally stupid or is this a google limitation? I have tried it a hundred times and can't get it to work. PLEASE HELP.

  • Wow, the plot thickens. I just happened to stumble across something else. I found out I CAN add a 12th point, but it will only display the points if I open a new browser. If I try to refresh even it won't display all the points, but if I close and reopen it does. WTF? The new map is at http://www.maptest.freehosting.com/chi12.html – Scott Orbin Apr 30 '12 at 22:36

1 Answers1

1

Look, you're OVER_QUERY_LIMIT, meaning too many requests in a short period of time. The official definition is indicates that you are over your quota., but elsewhere it says 2,500 requests per day. So it's not directly saying it's not OK to query too many times quickly.

Add an else statement to match the if(status == OK) and write alert(status) to see this error. Sometimes the server will delay, other times, not, so the point where the server will deny the request is unknown.

 else{ alert(status) }

You need either setTimeout(function() { }, time) between requests or this sleep function from Kiessling's Node beginner:

function sleep(milliSeconds) {
    var startTime = new Date().getTime();
    while (new Date().getTime() < startTime + milliSeconds);
  }

I can't tell you how long to wait, I have no clue what the Google servers consider too much.

Also, look up the async library. I'm not too familiar with it but it may allow you to write the requests in a for loop. Its forEach function looks most promising.

Tina CG Hoehr
  • 6,721
  • 6
  • 44
  • 57