2010-09-01 99 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