Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/430.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Google Places API-加载位置类型onclick_Javascript_Google Maps_Google Maps Api 3_Google Places Api_Google Places - Fatal编程技术网

Javascript Google Places API-加载位置类型onclick

Javascript Google Places API-加载位置类型onclick,javascript,google-maps,google-maps-api-3,google-places-api,google-places,Javascript,Google Maps,Google Maps Api 3,Google Places Api,Google Places,我正在将“学校”地点类型加载到地图中,并希望能够在单击链接时加载另一个地点类型,如下图所示: 因此,单击链接后,我调用我的映射函数并传入类型,例如: initializePropertyMap('train_station'); 这样做效果很好,但当我点击“展示学校”或“展示火车站”链接时,每次返回的名额越来越少。例如,如果重复单击“显示学校”链接,则每次返回的学校都会减少。有人知道为什么会这样吗 看起来您超出了谷歌地图API的使用限制。在if语句之后 if(status == google

我正在将“学校”地点类型加载到地图中,并希望能够在单击链接时加载另一个地点类型,如下图所示:

因此,单击链接后,我调用我的映射函数并传入类型,例如:

initializePropertyMap('train_station');
这样做效果很好,但当我点击“展示学校”或“展示火车站”链接时,每次返回的名额越来越少。例如,如果重复单击“显示学校”链接,则每次返回的学校都会减少。有人知道为什么会这样吗



看起来您超出了谷歌地图API的使用限制。在if语句之后

if(status == google.maps.places.PlacesServiceStatus.OK) {
添加else语句,并记录失败的请求。您会发现返回的状态为
超过\u查询\u限制


.

您不是每次都重置
for
循环中的
计数吗,因为
var count=0
位于
for
循环中?另外,应该删除
addDomListener
中的执行括号
()
。谢谢,你说得对。看来我需要想出一个更好的方法来显示/隐藏这些地方