Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用谷歌API上的LatLng获取街景图像_Javascript_Google Maps_Google Maps Api 3_Google Street View - Fatal编程技术网

Javascript 使用谷歌API上的LatLng获取街景图像

Javascript 使用谷歌API上的LatLng获取街景图像,javascript,google-maps,google-maps-api-3,google-street-view,Javascript,Google Maps,Google Maps Api 3,Google Street View,我想得到一个图像,这是从谷歌街景与LatLng信息 我几乎阅读了谷歌服务的文档内容,但我找不到我想要的选项 还有什么我可以参考的吗?这里有一对来自谷歌的好例子 建立一个合适的网页并包含所有相关信息,这并不困难 示例2的代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Street View service</tit

我想得到一个图像,这是从谷歌街景与LatLng信息

我几乎阅读了谷歌服务的文档内容,但我找不到我想要的选项


还有什么我可以参考的吗?

这里有一对来自谷歌的好例子 建立一个合适的网页并包含所有相关信息,这并不困难

示例2的代码

  <!DOCTYPE html>
  <html>
    <head>
      <meta charset="utf-8">
      <title>Street View service</title>
      <style>
        html, body, #map-canvas {
          height: 100%;
          margin: 0;
          padding: 0;
        }

      </style>
      <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
      <script>
  function initialize() {
    var fenway = new google.maps.LatLng(42.345573, -71.098326);
    var mapOptions = {
      center: fenway,
      zoom: 14
    };
    var map = new google.maps.Map(
        document.getElementById('map-canvas'), mapOptions);
    var panoramaOptions = {
      position: fenway,
      pov: {
        heading: 34,
        pitch: 10
      }
    };
    var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
    map.setStreetView(panorama);
  }

  google.maps.event.addDomListener(window, 'load', initialize);

      </script>
    </head>
    <body>
      <div id="map-canvas" style="width: 45%; height: 100%;float:left"></div>
      <div id="pano" style="width: 45%; height: 100%;float:left"></div>
    </body>
  </html>

街景服务
html,正文,#地图画布{
身高:100%;
保证金:0;
填充:0;
}
函数初始化(){
var fenway=new google.maps.LatLng(42.345573,-71.098326);
变量映射选项={
中心:芬威,
缩放:14
};
var map=new google.maps.map(
document.getElementById('map-canvas')、mapOptions);
变量全景选项={
位置:芬威,
pov:{
标题:34,
投球:10
}
};
var panorama=new google.maps.StreetViewPanorama(document.getElementById('pano'),panoramoptions);
地图设置树视图(全景);
}
google.maps.event.addDomListener(窗口“加载”,初始化);
还是最简单的嵌入式访问


全部来自谷歌

谢谢你的评论。我要读它@小巨人你想让街景看到那块板条吗?从那个板条往某个方向看?