2017-02-01 20 views
0

Наше приложение работает отлично утром, возможно, до тех пор, пока квота не закончится, но после этого он никогда не работает в тот же день. Мы столкнулись с ошибкой.Ошибка OVER_QUERY_LIMIT для Карт Google после 2500 запросов

Поскольку мы используем услугу Premium и зарегистрированный клиент для карт версии 3, все выглядит нормально. Отсрочка или тайм-аут не должны работать так, как кажется, это происходит в каком-то цикле.

Вот код:

_resolveInitialLocation: function() { 
        var url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + this._currentLatitude + "," + this._currentLongitude; 


      if (this._customerAddress) { 

       url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + this._customerAddress; 
      } 

      return xhr(url, { 
       headers: { "X-Requested-With": null }, 
       handleAs: "json" 
      }).then(lang.hitch(this, function (place) { 
       // this._search(place.results[0]); 
       this._place = place.results[0]; 

       if (dom.byId("pac-input")) { 
        dom.byId("pac-input").value = this._place.formatted_address; 
       } 

       this._currentLatitude = this._place.geometry.location.lat; 
       this._currentLongitude = this._place.geometry.location.lng; 
      })); 
     }, 

     _initGoogleMaps: function (/* Boolean */ preSearch) { 
      // summary 
      //  this function will initialize google maps api 
      // tags 
      //  branch locator, google maps, maps 

      if (this._place) { 
       this._currentLatitude = typeof this._place.geometry.location.lat === "function" ? this._place.geometry.location.lat() : this._place.geometry.location.lat; 
       this._currentLongitude = typeof this._place.geometry.location.lng === "function" ? this._place.geometry.location.lng() : this._place.geometry.location.lng; 
      } 

      var initialLocation = new 

google.maps.LatLng(this._currentLatitude, this._currentLongitude); 
       . 
.. 
.. 
       }; 

Пожалуйста, смотрите ошибку ниже мы столкнулись. Мы используем JavaScript-скрипт Dojo java.

есть запрос HTTP ошибка Достаньте из googleapis.com:

https://maps.googleapis.com/maps/api/geocode/json?latlng=22.280297,114.159514 
{ 
"error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_", 
"results" : [], 
"status" : "OVER_QUERY_LIMIT" 
} 

Спасибо заранее.

ответ

1

Если вы являетесь зарегистрированным клиентом для карт версии 3 с учетной записью Premium, скорее всего, в URL-адресе отсутствует параметр для «API KEY».

Если вы используете API под премиум план Google Maps API, вы есть два варианта аутентификации: Используйте ключ API, установленный в проекте Google API Карт Премиум план, созданный для вас, когда вы приобрели Premium Plan, или используйте свой идентификатор клиента вместо ключа API. Source.

+0

Благодаря GibboK, это URL-мы hitting..https:? //maps.googleapis.com/maps/api/js клиент = GME-ABCD и датчик = ложно & v = 3 и библиотеки = геометрии, места и обратного вызова = initGoogleMaps В URL , Я только изменил название компании с abcd. Помогите, если с ней что-то не так. –

+0

@SandipMante благодарит за ваше сообщение, если вы считаете, что мой ответ был полезен, пожалуйста, не забывайте поднимать или принимать его, используя значок стрелки вверх или галочку на левой стороне. Спасибо и счастливое кодирование! – GibboK