Over Query limit

roaddev

Here I have a code to show me google places objects when search in boxes.

So:

function findPlaces(boxes,searchIndex) {
   var request = {
       bounds: boxes[searchIndex],
            types: ["museum"]
   };
   // alert(request.bounds);
   service.nearbySearch(request, function (results, status) {
   if (status != google.maps.places.PlacesServiceStatus.OK) {
     alert("Request["+searchIndex+"] failed: "+status);
     return;
   }
   // alert(results.length);
   document.getElementById('side_bar').innerHTML += "bounds["+searchIndex+"] returns "+results.length+" results<br>"
   for (var i = 0, result; result = results[i]; i++) {
     var marker = createMarker(result);
   }
   searchIndex++;
   if (searchIndex < boxes.length) 
     findPlaces(boxes,searchIndex);
   });
}

but if box is empty I get error: Request[i].failed ZERO_RESULT My first question is How to JUMP over this, so how go to next box and this just jump becouse there is no results

Also some time I get OVER_QUERY_LIMIT - How I can solve this problem?

UPDATE: I TRY LIKE THET TO SOLVE PROBLEM BUT AGAIN IS THE SAME:

function findPlaces(boxes,searchIndex) {
   var request = {
       bounds: boxes[searchIndex],
            types: ["museum"]
   };
   // alert(request.bounds);
   service.nearbySearch(request, function (results, status) {
   if (status != google.maps.places.PlacesServiceStatus.OK) {
//JUMP TO THE NEXT
     searchIndex++;

   }
   // alert(results.length);
   document.getElementById('side_bar').innerHTML += "bounds["+searchIndex+"] returns "+results.length+" results<br>"
   for (var i = 0, result; result = results[i]; i++) {
     var marker = createMarker(result);
   }
//WAIT 3000 TO THE NEW REQUEST
      setTimeout(function () {
    alert('hello');
  }, 3000);
   searchIndex++;
   if (searchIndex < boxes.length) 
     findPlaces(boxes,searchIndex);
   });
}
m.e.conroy
service.nearbySearch(request, function (results, status) {
    if (status != google.maps.places.PlacesServiceStatus.OK) {
        // you probably don't even need the test for 'ZERO_RESULT' just test
        // your index against the boxes array for more items to search since
        // status could be a different error
        if((status == 'ZERO_RESULT') && (++searchIndex < boxes.length)){
            findPlaces(boxes,searchIndex);
        }else{
            return;
        }
    }else{
        document.getElementById('side_bar').innerHTML += "bounds["+searchIndex+"] returns "+results.length+" results<br>"
        for (var i = 0, result; result = results[i]; i++) {
            var marker = createMarker(result);
        }
        if (++searchIndex < boxes.length) 
            findPlaces(boxes,searchIndex);
    }
});

Ok, I didn't see that you wanted to output a zero result in your sidebar, in this case you don't need to check for status OK since results will have nothing anyhow. Try this:

service.nearbySearch(request, function (results, status) {
    document.getElementById('side_bar').innerHTML += "bounds["+searchIndex+"] returns "+results.length+" results<br>"
    for (var i = 0;i<results.length; i++) {
        var marker = createMarker(results[i]);
    }
    if (++searchIndex < boxes.length) 
        setTimeout(findPlaces(boxes,searchIndex),500);
});

EDIT - Maybe this:

service.nearbySearch(request, function (results, status) {
    if(status == 'OVER_QUERY_LIMIT'){
        setTimeout(findPlaces(boxes,searchIndex),1000);
    }else{
        document.getElementById('side_bar').innerHTML += "bounds["+searchIndex+"] returns "+results.length+" results<br>"
        for (var i = 0;i<results.length; i++) {
            var marker = createMarker(results[i]);
        }
        if (++searchIndex < boxes.length) 
            setTimeout(findPlaces(boxes,searchIndex),1000);
    }
});

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Google Maps API OVER_QUERY_LIMIT

分類Dev

Google geocoding API: OVER_QUERY_LIMIT despite very low usage

分類Dev

GoogleマップのジオコーディングOVER_QUERY_LIMIT

分類Dev

Google MapsAPIのOVER_QUERY_LIMIT-クライアント側へのphp

分類Dev

Android SearchRecentSuggestionsProvider query limit

分類Dev

LIMIT not working on complex query

分類Dev

Parse "or" query with limit returns all records ignoring limit on single query

分類Dev

Limit amount of parameters in query string

分類Dev

Cypher query limit results and delete

分類Dev

Ruby on Rails query limit in a range

分類Dev

新しいAPIキーを使用したGoogleプレイスライブラリOVER_QUERY_LIMIT

分類Dev

2つ以上のリクエストでGoogleElevationServiceを使用して `OVER_QUERY_LIMIT`エラーをヒット

分類Dev

3つ以上の要素を持つGoogleマップの距離行列はOVER_QUERY_LIMITを返します

分類Dev

最初のリクエストのOVER_QUERY_LIMIT回答を受け取るのはなぜですか?

分類Dev

SPARQL Query with filtering over an integer

分類Dev

Is there a limit to the query length being passed to ADODB?

分類Dev

Limit query by count distinct column values

分類Dev

Limit tables shown in DevExpress Dashboard - Query Builder

分類Dev

Is there a way to limit query results by values in an IN list?

分類Dev

Limit the initial (anchor) values of a recursive query (with statement)

分類Dev

MongoDB : limit query to a field and array projection

分類Dev

Going over the Microsoft Edge Read Aloud Speed Limit

分類Dev

Partition by week/month//quarter/year to get over the partition limit?

分類Dev

OVER_QUERY_LIMIT応答を受信せずに20の住所をジオコーディングするにはどうすればよいですか?

分類Dev

オートコンプリート中にオートコンプリートエラーを配置する:OVER_QUERY_LIMIT

分類Dev

SQL query - limit resulting query rows based on non sorted value

分類Dev

Is there a limit on the number of rows I can update via an IN clause of a MySQL query?

分類Dev

How to apply a limit just for joining table in MySQL query?

分類Dev

Cake php query for limit that returns starting record no and total no records

Related 関連記事

  1. 1

    Google Maps API OVER_QUERY_LIMIT

  2. 2

    Google geocoding API: OVER_QUERY_LIMIT despite very low usage

  3. 3

    GoogleマップのジオコーディングOVER_QUERY_LIMIT

  4. 4

    Google MapsAPIのOVER_QUERY_LIMIT-クライアント側へのphp

  5. 5

    Android SearchRecentSuggestionsProvider query limit

  6. 6

    LIMIT not working on complex query

  7. 7

    Parse "or" query with limit returns all records ignoring limit on single query

  8. 8

    Limit amount of parameters in query string

  9. 9

    Cypher query limit results and delete

  10. 10

    Ruby on Rails query limit in a range

  11. 11

    新しいAPIキーを使用したGoogleプレイスライブラリOVER_QUERY_LIMIT

  12. 12

    2つ以上のリクエストでGoogleElevationServiceを使用して `OVER_QUERY_LIMIT`エラーをヒット

  13. 13

    3つ以上の要素を持つGoogleマップの距離行列はOVER_QUERY_LIMITを返します

  14. 14

    最初のリクエストのOVER_QUERY_LIMIT回答を受け取るのはなぜですか?

  15. 15

    SPARQL Query with filtering over an integer

  16. 16

    Is there a limit to the query length being passed to ADODB?

  17. 17

    Limit query by count distinct column values

  18. 18

    Limit tables shown in DevExpress Dashboard - Query Builder

  19. 19

    Is there a way to limit query results by values in an IN list?

  20. 20

    Limit the initial (anchor) values of a recursive query (with statement)

  21. 21

    MongoDB : limit query to a field and array projection

  22. 22

    Going over the Microsoft Edge Read Aloud Speed Limit

  23. 23

    Partition by week/month//quarter/year to get over the partition limit?

  24. 24

    OVER_QUERY_LIMIT応答を受信せずに20の住所をジオコーディングするにはどうすればよいですか?

  25. 25

    オートコンプリート中にオートコンプリートエラーを配置する:OVER_QUERY_LIMIT

  26. 26

    SQL query - limit resulting query rows based on non sorted value

  27. 27

    Is there a limit on the number of rows I can update via an IN clause of a MySQL query?

  28. 28

    How to apply a limit just for joining table in MySQL query?

  29. 29

    Cake php query for limit that returns starting record no and total no records

ホットタグ

アーカイブ