문제

When you create a street view without any location you get a gray box with the controls.

var panorama = new  google.maps.StreetViewPanorama(element.find('.header')[0],{ });

Later upon some user action I set the location.

panorama.setPosition(place.geometry.location);

Great everything works fine!

But how do I get back to that gray box with the controls overlaid. Reset the Street View so to speak?

I have a map paired with this and I want the Street View little man with the arrow he stands on to go away as well, this should happen naturally with the reset.

도움이 되었습니까?

해결책

set the visible-property of the panorama to false

panorama.setVisible(false);

When you want to programmatically show the panorama again later, set the visible -property back to true(this will be done automatically when the user drops the pegman back to the map)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top