我正在讨论在这些论坛中讨论的问题,但是没有一个建议似乎对我有用,所以我正在寻找一些完整的javascript,当保存为html文件时有效.
问题是当我尝试使用Javascript调用的V3 API在Google Map上对11个位置进行地理编码时,我一直遇到OVER_QUERY_LIMIT错误.我知道你可以调用地址解码器的速率是有限的(以及总音量的每日限制),所以我需要在数组中的每个结果之间引入一个暂停.
任何帮助非常感谢.
这是我的代码:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
var map;
var wait = false;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(51.32, 0.5);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
codeAddress('KT16 8LA' + ', UK');
codeAddress('LS8 2LQ' + ', UK');
codeAddress('NE13 8AF' + ', UK');
codeAddress('KT12 2BE' + ', UK');
codeAddress('W1W 8AN' + ', UK');
codeAddress('EC3N 2LS' + ', UK');
codeAddress('BS9 3BH' …Run Code Online (Sandbox Code Playgroud) 我正在与具有驱动程序跟踪模块的项目一起工作。我的数据库纬度/经度,我是按日期和用户名获取的。
当前的实现效果很好,大约10 lat / long。但是,当它的纬度/经度数量更多时,它只是在前10个点之间绘制路径。
对于其他人,它的状态为 OVER_QUERY_LIMIT
正如其他人在此建议的那样,我不得不延迟每个定向服务请求。
我已经搜索了很多,但是找不到任何值得注意的解决方案。
这是我的代码。
var markers = [{
"Latitude": -33.7316000000,
"Longitude": 151.0789000000
}, {
"Latitude": -33.7316000000,
"Longitude": 151.0788000000
}, {
"Latitude": -33.7316000000,
"Longitude": 151.0789000000
}, {
"Latitude": -33.7316000000,
"Longitude": 151.0789000000
}, {
"Latitude": -33.7316000000,
"Longitude": 151.0789000000
}, {
"Latitude": -33.7247000000,
"Longitude": 151.0859000000
}, {
"Latitude": -33.7243000000,
"Longitude": 151.0967000000
}, {
"Latitude": -33.7198000000,
"Longitude": 151.1062000000
}, {
"Latitude": -33.7109000000,
"Longitude": 151.1043000000
}, {
"Latitude": -33.7029000000,
"Longitude": 151.0992000000
}, {
"Latitude": -33.7108000000,
"Longitude": 151.1044000000 …Run Code Online (Sandbox Code Playgroud)