Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.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
来自json和javascript的未定义对象_Javascript_Json_Google Maps_Google Places Api_Sidebar - Fatal编程技术网

来自json和javascript的未定义对象

来自json和javascript的未定义对象,javascript,json,google-maps,google-places-api,sidebar,Javascript,Json,Google Maps,Google Places Api,Sidebar,在这里,我有一个创建带有链接的地图和sibar的代码,但在infowindow中一切正常,在侧边栏中,我只得到未定义的文本: (只需点击提交) 那么到底是什么问题呢 代码: var side_bar_html=“”; document.getElementById('side\u bar')。innerHTML+=side\u bar\u html; } 您正在使用的 从文件中: radarSearch()返回的PlaceResult对象将仅包括geometry.location和referen

在这里,我有一个创建带有链接的地图和sibar的代码,但在infowindow中一切正常,在侧边栏中,我只得到未定义的文本:

(只需点击提交)

那么到底是什么问题呢

代码:

var side_bar_html=“
”; document.getElementById('side\u bar')。innerHTML+=side\u bar\u html; }
您正在使用的

从文件中:

radarSearch()返回的PlaceResult对象将仅包括geometry.location和reference属性


没有.name属性

您需要使用,该属性限制为60个结果,分为三组,每组20个。是的,但请在我的代码中的示例中显示,您可以修复侧栏以使用nearbySearch吗?这就是我在评论中所说的。。。60分为三组,每组20人。
 var side_bar_html = "<a href='javascript:google.maps.event.trigger(gmarkers["+parseInt(gmarkers.length-1)+"],\"mouseover\");'>"+place.name+"</a><br>";
    document.getElementById('side_bar').innerHTML += side_bar_html;
}