我试图捕捉街景小人图标何时落在谷歌地图上并将全景位置和缩放发送到服务器。下面的代码用于监听 visible_changed 事件。但是 thePanorama.getZoom() 和 getPosition() 返回未定义。
thePanorama = map.getStreetView();
streetviewChangeListener = google.maps.event.addListener(thePanorama, 'visible_changed', function() {
console.log('visible_changed ');
console.log('streetview panorama position: ' + thePanorama.getPosition() + ' zoom: ' + thePanorama.getZoom());
emitStreetViewEvents({position: thePanorama.getPosition(), zoom: thePanorama.getZoom()});
});
帮助?