Google Maps Places api, how do I get the standard infowindow content from a marker

我只是一个虾纸丫 提交于 2019-12-05 07:11:31
billcbos

I finally located some code for formatting the infoWindow in another post where they were answering a question about removing the border for the infoWindow.

Here is my example :

 infowindow.setContent('<span style="padding: 0px; text-align:left" align="left"><h5>' + place.name + '&nbsp; &nbsp; ' + place.rating 
                            + '</h5><p>' + place.formatted_address + '<br />' + place.formatted_phone_number + '<br />' +  
                            '<a  target="_blank" href=' + place.website + '>' + place.website + '</a></p>' ) ;

I also figured out how to use the getDetails function described in the Places Library

I still don't know how to get the rating information (I'm using the tag but it gives an error), how to retrieve the image for the location, nor how to eliminate the "undefined" error from appearing.

Last element is to have the infoWindow open when the map loads... I saw a post about it but couldn't get it to work.

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