Undefined objects from json with javascript

こ雲淡風輕ζ 提交于 2019-12-11 19:36:16

问题


Here I have a code for creating map and sibar with links, but in infowindow all is ok, and in sidebar I only get undefined text:

http://jsbin.com/EVEWOta/23 (just click submit)

So what is exactly the problem?

CODE:

 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;
}

回答1:


You are using RadarSearch.

From the documentation:

PlaceResult objects returned by radarSearch() will only include the geometry.location and reference properties.

There is no .name property



来源:https://stackoverflow.com/questions/18499291/undefined-objects-from-json-with-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!