Try this sample.
http://marx-tseng.appspot.com/maps/Map_Street_View.html

On 7月20日, 上午11時07分, CSharp <[email protected]> wrote:
> Man, this StreetView is hard to deal with in conjunction with the
> InfoWindow.  The reason being is that the content settings in both are
> not consistent.  With the InfoWindow, you can inject the content with
> jQuery, HTML, or almost any text string.  With the StreetViewPanorama
> constructor, it can only inject a node via a valid
> document.getElementById.
>
> My problem is this:
>
> 1) I have a variable as follows:
>
> var someDivContainer = "<div id='outsideContainer'>" +
>                                           "<div
> id='insideContainer1'>Please Wait...</div>" +
>                                           "<div
> id='insideContainer2'>Blah, Blah, Blah,...</div>" +
>                                           "<div
> id='streetViewContainer'></div>"+
>                                    "</div>"
>
> 2) now I set the InfoWindow to contain the above:
>
> var infoWindow = new google.maps.InfoWindow({zIndex: 1});
> infoWindow.setContent(someDivContainer);
>
> 3) finally, I want to set the StreetViewPanorama to the
> "streetViewContainer" as defined in the dynamic HTML in
> someDivContainer
>
> var streetView = new google.maps.StreetViewPanorama(???);
>
> -----------------------
>
> I've tried using jQuery to get the inside containers like this:
>
> var streetViewContainerObj = infoWindow.getContent();
> var streetView = new google.maps.StreetViewPanorama($
> (streetViewContainerObj).find("#streetViewContainer"));  //get
> javascript error coming from Google Map API
>
> I've tried writing out the DIV containers as static HTML on the page
> and then reference the streetViewContainer directly using
> document.getElementId like this:
>
> var streetView = new
> google.maps.StreetViewPanorama(document.getElementById("streetViewContainer 
> "));  //
> get Google Map API error, especially when containers are set to the
> style of "display:none".
>
> Can someone please tell me how I can obtain a proper node to shove
> into the StreetViewPanorama object so that it can display a StreetView
> properly?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to