来自json的未定义对象与javascript(Undefined objects from json with javascript)
这里我有一个用于创建带有链接的地图和sibar的代码,但是在infowindow中一切都没问题,在侧边栏中我只得到未定义的文本:
http://jsbin.com/EVEWOta/23 (只需点击提交)
那究竟是什么问题呢?
码:
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; }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; }最满意答案
您正在使用RadarSearch 。
从文档:
由radarSearch()返回的PlaceResult对象仅包含geometry.location和reference属性。
没有.name属性
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
更多推荐
side_bar_html,sibar,infowindow,问题,电脑培训,计算机培训,IT培训"/> <meta name=&
发布评论