有沒有人有使用API在Squarespace上工作的Google街景視圖示例?有沒有人有使用API在Squarespace上工作的谷歌街景示例?
我已經能夠使用其他示例來顯示谷歌地圖(非街景),但是當我試圖讓Google的街景example工作...沒有。
這裏是我的嘗試: http://keweenaw.squarespace.com/googlemapsapitest
我有這樣的代碼在我的網頁標題代碼注入
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#street-view {
height: 100%;
}
</style>
<script>
var panorama;
function initialize() {
panorama = new google.maps.StreetViewPanorama(
document.getElementById('street-view'),
{
position: {lat: 37.869260, lng: -122.254811},
pov: {heading: 165, pitch: 0},
zoom: 1
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key= AIzaSyBSlsYgCGP7KfS5doe_q0X9guiJ3WNrfns&callback=initialize">
</script>
這在頁面上的代碼塊:
<div id="street-view""></div>
謝謝你的幫助! –