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