javascript - Street View panorama is grey? -
i have built page displays different views of location e.g. roadmap, satellite , streetview.
when try display streetview panorama not working. have separate div each map view. here example of code , html using streetview.
var panoramaoptions = { position: new google.maps.latlng(-41.34473283543335, 174.7694693629674), pov: { heading: 34, pitch: 10 }, visible:true }; var panorama = new google.maps.streetviewpanorama(document.getelementbyid('street_view'),panoramaoptions); panorama.setvisible(true); <div class='map-big' id='street_view' style='overflow:hidden;'></div>
how can display streetview properly?
best guess:
ran similar issue streetview when tried toggling between standard map view , street view.
did 2 things fix issue:
1. when switched street view, re-ran setposition on streetview.
ran:
g_map.getstreetview().setposition(g_position);
i used cache streetview object
g_streetview = g_map.getstreetview(); g_streetview.setposition(place);
i stopped doing that, , call long version
g_map.getstreetview().setposition(place);
hope helps!
Comments
Post a Comment