Google街景https请求是以html格式输出链接,而不是发送请求

Google Street View https request is outputting link in html rather than sending request

本文关键字:请求 链接 格式 https 街景 html Google 输出      更新时间:2023-09-26

我正在附近的地图工作,在我的信息窗口,我想有一个小div,包含体育场的街景。我为每个位置创建了一个独特的https请求,唯一的事情是它打印实际链接,而不是发出请求并显示谷歌地图街景图像。我将有下面的问题代码,以及链接到github存储库的项目

lInfowindow.setContent("<div><h2>" + currentMarker.content.name + "</h2><h3>" + currentMarker.content.address + "</h3><div>" + currentMarker.content.streetViewRequest + "</div></div>");

github repository: https://github.com/omar-jandali/neighborhood-map

当你想要绘制图像时,你必须使用<img/>

lInfowindow.setContent("<div><h2>" + currentMarker.content.name + "</h2><h3>" + 
                        currentMarker.content.address + "</h3><div> <img src='" + 
                        currentMarker.content.streetViewRequest + "'/> </div></div>");