0
我使用v3地圖JS API google.maps.getPanoramaByLocation創建一個鏈接到latview/lng,看起來像︰http://maps.google.com/?cbll=52.099659,0.140299&cbp=12,0,,,&layer=c,但我想知道如果有人知道如何擺脫默認情況下出現在街景視圖中的大型左側邊欄?我檢查了mapki但沒有骰子。鏈接到谷歌地圖街景時擺脫側邊欄
我使用v3地圖JS API google.maps.getPanoramaByLocation創建一個鏈接到latview/lng,看起來像︰http://maps.google.com/?cbll=52.099659,0.140299&cbp=12,0,,,&layer=c,但我想知道如果有人知道如何擺脫默認情況下出現在街景視圖中的大型左側邊欄?我檢查了mapki但沒有骰子。鏈接到谷歌地圖街景時擺脫側邊欄
考慮下面的例子。它使用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>
截圖:
我創建一個鏈接,而不是創造一個全景自己之後。 我們可能會這樣做,並在我們的網站上創建一個彈出式對話框,但最初我們計劃只在街景視圖上有一個鏈接。 – 2010-09-02 09:32:52
@Ian:這是已知的Google地圖參數列表:http://mapki.com/wiki/Google_Map_Parameters。但是,似乎沒有選擇刪除側欄。也許'output = embed'很接近,但這不適用於鏈接。 – 2010-09-02 11:30:14
是的,我在我的問題中包含了mapki的鏈接。我曾在那裏看過,但沒有發現任何東西。因此在這裏問。 – 2010-09-03 08:48:57