2010-09-01 92 views

回答

0

考虑下面的例子。它使用getPanoramaByLocation()方法,并没有呈现左侧栏:

<!DOCTYPE html> 
<html> 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
    <title>Google Maps API v3 - Street View Demo</title> 
    <script src="http://maps.google.com/maps/api/js?sensor=false" 
      type="text/javascript"></script> 
    </head> 
    <body> 
    <div id="pano" style="width: 400px; height: 300px;"></div> 
    <script type="text/javascript"> 
     var panorama = new google.maps.StreetViewPanorama(
     document.getElementById('pano') 
    ); 
     var sv = new google.maps.StreetViewService(); 
     sv.getPanoramaByLocation(
     new google.maps.LatLng(42.345573,-71.098326), 
     50, 
     function (data, status) { 
      if (status == google.maps.StreetViewStatus.OK) { 
      panorama.setPano(data.location.pano); 
      panorama.setPov({ heading: 270, pitch: 0, zoom: 1 }); 
      panorama.setVisible(true); 
      } 
     } 
    ); 
    </script> 
    </body> 
</html> 

截图:

Google Maps API v3 - Street View Demo

+0

我创建一个链接,而不是创造一个全景自己之后。 我们可能会这样做,并在我们的网站上创建一个弹出式对话框,但最初我们计划只在街景视图上有一个链接。 – 2010-09-02 09:32:52

+0

@Ian:这是已知的Google地图参数列表:http://mapki.com/wiki/Google_Map_Parameters。但是,似乎没有选择删除侧栏。也许'output = embed'很接近,但这不适用于链接。 – 2010-09-02 11:30:14

+0

是的,我在我的问题中包含了mapki的链接。我曾在那里看过,但没有发现任何东西。因此在这里问。 – 2010-09-03 08:48:57