问题
I have a Google Street View that I have added using the Google Maps JavaScript API v3. You can see it here. Most of what the map does is fine. The only problem is that the Street View seems to be displaying the location in a weird spherical effect. I just want the street view to be the same as it is on here with just the straight image of the location without any panorama effect.
The code I have used is here:
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDvvLfsqnDzgL4oe6HhKgVpmlosjKGME8E"></script>
<script>
function initialize() {
var fenway = new google.maps.LatLng(51.453484, -2.600000);
var panoramaOptions = {
position: fenway,
pov: {
heading: 225,
pitch: 20
},
linksControl: false,
scrollwheel: false,
clickToGo: true
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="pano" style="width: 1920px; height: 560px;"></div>
Please tell me if I am missing something.
回答1:
Thanks for answering my question. The issue has now been solved. It turns out it is a Firefox-specific issue.
I'm now quoting the solution from user3109401's post from the link.
There's a undocumented attribute "mode" can be set in PanoramaOptions. You can use 'html4', 'html5' and 'webgl'. It will be no fish-eye effect if I set the mode to 'html5'. (But tourdash uses 'webgl' instead)
var panoramaOptions = {
pano : panoId,
pov: {
heading: heading,
pitch: pitch
},
enableCloseButton:false,
addressControl:false,
panControl:false,
visible: true,
clickToGo:false,
addressControl:false,
mode : "html5",
zoomControlOptions:{
position : google.maps.ControlPosition.TOP_LEFT
}
};
来源:https://stackoverflow.com/questions/28150715/remove-google-street-view-panorama-effect