街景图API的响应怎么办?

What to do with the response of Street View Image API?

我刚开始使用街景图像API,但是当我调用它时,它returns只是一个巨大的不可读的字符串。

我该如何将该字符串转换为实际图像?谢谢

这是我使用 jQyuery 提出的 AJAX 请求:

        $.ajax({
        method: "GET",
        url: "https://maps.googleapis.com/maps/api/streetview",
        success: function(data) {
            console.log(data);
        },
        data: {
            size: "600x300",
            location: "46.414382,10.013988",
            heading: "151.78",
            pitch: "-0.76",
            key: key
        }
    });

如@scaisEdge 所述,它 returns 一张图片,直接使用 URL 作为 <img>src

jQuery(
  function($) {
    $('#streetview')
      .attr('src', 'https://maps.googleapis.com/maps/api/streetview?' + $.param({
        size: "600x300",
        location: "46.414382,10.013988",
        heading: "151.78",
        pitch: "-0.76",
        //key:key
      })).show();
  }
);
#streetview {
  display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<img id="streetview" />