Fixed
Status Update
Comments
nd...@cybit.co.uk <nd...@cybit.co.uk> #2
Sorry, it appears the listener is a red-herring - the same effect is observed with the listener removed.
mi...@gmail.com <mi...@gmail.com> #3
Thank you for your report, this seems to happen only on IE 8 when calling panorama.setVisible(false) before dropping the pegman.
nd...@cybit.co.uk <nd...@cybit.co.uk> #4
I've been doing some more playing with this myself to try and work around it (I only show the div when the user drops the pegman, the user usually has a full-screen map). Having tried to work around it and removed all references to panorama.setVisible(false) I still get the error so perhaps the problem is more deep-rooted or setVisible(false) is called internally by the API at some point.
Description
I'm sure this was not the case a few days ago. Sample page below to reproduce the problem. Changing the setVisible(false) to be before the listener is defined makes no difference.
<html>
<head>
<script type="text/javascript" src="
<script type="text/javascript">
var paris;
var map;
function initialize() {
paris = new google.maps.LatLng(48.85661, 2.35077);
var mapOptions = {
zoom: 8,
center: paris,
scaleControl: true,
streetViewControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var panoramaOptions = {
enableCloseButton: true
};
panorama = new google.maps.StreetViewPanorama(document.getElementById("pano"),panoramaOptions); //Create the main Street View Panorama object.
map.setStreetView(panorama); //bind it to the map to override the default one.
google.maps.event.addListener(panorama,'visible_changed',function() {
alert("listener fired");
});
panorama.setVisible(false);
}
</script>
</head>
<body onload="initialize()">
<div id="pano" style="width:100%; height:300px; top:0px;"></div>
<div id="map_canvas" style="width:100%; height:300px;"></div>
</body>
</html>