【发布时间】:2017-02-01 08:41:29
【问题描述】:
我们的应用程序在早上可以正常运行,可能要等到配额用完,但在那之后它就无法在当天运行。我们面临以下错误。
由于我们使用的是高级服务,并为地图版本 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);
.
..
..
};
请查看我们面临的以下错误。我们正在使用 Dojo java 脚本库。
来自 googleapis.com 的 http 请求获取错误:
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"
}
提前致谢。
【问题讨论】:
标签: javascript dojo google-geocoder