0
我想要获取谷歌街景图像,并使用羽毛灯在灯箱中显示它们。图像是根据用户选择哪个地图图标动态定义的。羽毛与谷歌街景图像
我的图像显示没有问题,但灯箱冻结了一秒钟,然后返回一页随机字符,就好像图像已被尝试读取为文本一样。
我的代码示例如下:
let streetView_imgURL = "https://maps.googleapis.com/maps/api/streetview?size=600x300&location=" +
props.Latitude + "," + props.Longitude + "&key=MYKEY";
document.getElementById("selectedSchool").innerHTML = (props ?
"<div class='imgbox'>" +
"<img style='width:100%;' data-featherlight='" + streetView_imgURL + "'src='"
+ streetView_imgURL + "'>"
一个可行的例子会很棒。 –