Facebook评论在谷歌地图Infowindow流 [英] Facebook Comments Stream in Google Maps Infowindow
问题描述
我目前正在研究一个Google地图项目,显示当地城镇的兴趣点。我的计划是在地图上使用多个标记来标识不同的地方,当点击时会打开一个InfoWindow,列出有关地点的更多详细信息....我还认为允许访问者留下使用Facebook的评论和体验注意InfoWindow中的插件。
然而,在进一步研究和阅读其他人的努力尝试将Facebook注释放入InfoWindows中时,似乎并不可行。 。我看到的壁橱是一个设法让每个InfoWindow出现的SAME注释流,无论地图上哪个标记/点被选中....这不是我想要的!他的结论是在PHP中构建自己的注释流。以上链接指向上面的文章,它链接到工作中的地图;
https:/ /groups.google.com/forum/#!msg/google-maps-js-api-v3/4wvBdVxPHJ0/vxuYP93N-lgJ
我是对Facebook的开发来说很新,但当然不会介意攀爬学习曲线来达到我想要的效果,但认为明智的做法是与专家一起在stackoverflow上查看,以免我试图实现的目标不是初学者!
任何建议,建议和指针都会被感激地收到。
设法做到了。诀窍是将
$ b
- 插入隐藏div页面末尾的infowindow内容。 >
- 用
解析这个div> FB.XFBML.parse
- 获取
innerHTML
- 使用您之前获得的innerHTML调用
infowindow.setContent()
如果您想在每个infowindow中使用不同的注释,则必须为每个infowindow的注释插件使用不同的url:例如 http:// localhost?infowindow = content1
和 http:// localhost?infowindow = content2
for another。
希望有所帮助!
I’m currently working on a Google Maps project showing places of interest in my local town. My plan was to use multiple markers on the map to identify different places which when clicked on would open an InfoWindow listing more details about the place.... I also thought it would be good to allow visitors to leave comments and experiences using the Facebook Comments Plugin within the InfoWindow.
However, on further research and reading a couple of other peoples efforts into trying to get Facebook Comments into InfoWindows it doesn’t seem possible... the closet I’ve seen is a chap who managed to get the SAME comments stream appearing in every InfoWindow no matter which marker / point on map was selected.... which isn’t what I want! His conclusion was to build your own comments stream in PHP.
Here's the link to the above article which has a link to the map at work; https://groups.google.com/forum/#!msg/google-maps-js-api-v3/4wvBdVxPHJ0/vxuYP93N-lgJ
I’m pretty new to Facebook development but certainly don’t mind climbing the learning curve to achieve what I want, but thought it wise to check with the experts here at stackoverflow in case what I am trying to achieve is a non-starter!
Any suggestions, advice and pointers would be gratefully received.
I recently managed to do it. The trick is to
- insert the content of your infowindow on the end of the page in a hidden div.
- parse this div with
FB.XFBML.parse
- get the
innerHTML
of your div - call
infowindow.setContent()
with the innerHTML you got before
If you want different comments in every infowindow you must have a different url for every infowindow's comment plugin: like http://localhost?infowindow=content1
and http://localhost?infowindow=content2
for another.
Hope that helped!
这篇关于Facebook评论在谷歌地图Infowindow流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!