title: Google Maps StreetView displays only the first time
body: <p>I have a google map page populated with markers from database. In the marker InfoWindow is a clickable link that opens a jquery dialog with StreetView of the location.
  The problem is, that StreetView shows only the first time I click on the InfoWindow link. If I close the dialog and try to open it again (clicking on other infowindows or even the same one again) , I get my dialog with StreetView controls , the new address is shown too (with "Address is approximate") , but the rest of dialog is an uniform light grey color.</p>
  
  <p>I've tried some warkarounds posted on stackoverflow (like <a href="https://stackoverflow.com/questions/3322379/google-maps-v3-streetview-not-displaying-on-second-setvisible-call">this one</a>) but the grey dialog persists in my case.</p>
  
  <p>Edit : <a href="https://jsfiddle.net/L18o56zz/" rel="nofollow noreferrer">JSFiddle Example</a></p>
  
  <p>Marker creation with onclick listener:</p>
  
  <pre><code>function addMarker(feature) {
      var marker = new google.maps.Marker({
          position: feature.position,
          icon: icons[feature.type].icon,
          map: map
      });
      //Create Infowindow
      var infowindow = new google.maps.InfoWindow();
      var content = '&lt;h1 id="Heading" class="Heading"&gt;' + feature.shopName + '&lt;/h1&gt;' +
                    '&lt;div id="iwcontent" class="iwcontent"&gt;'+
                    '&lt;p&gt;&lt;b&gt;Naslov : &lt;/b&gt;' + feature.shopAddress + '&lt;/br&gt;' +
                    '&lt;p&gt;&lt;b&gt;Telefon : &lt;/b&gt;' + feature.shopTel + '&lt;/br&gt;' +
                    '&lt;/div&gt;'+
                    '&lt;div id="iwsw" class="iwsw"&gt;StreetView&lt;/div&gt;'
                    ;
      //Call StreetView
      google.maps.event.addDomListener(infowindow, 'domready', function () {
          $('.iwsw').click(function () {
              showStreetView(feature.position);
          });
      });
      .
      .
      .
  </code></pre>
  
  <p>showStreetView function:</p>
  
  <pre><code>//Display dialog with streetview
  function showStreetView(position){
      var panoramaOptions = {position: position, pov: {heading: 34,pitch: 10}};
      var panorama = new  google.maps.StreetViewPanorama(document.getElementById("dialog-sw-canvas"), panoramaOptions);
      map.setStreetView(panorama);
      $( "#dialog-sw-canvas" ).dialog("open");
  }
  </code></pre>
  
  <p>Dialog definition:</p>
  
  <pre><code>$(function(){
      $('#dialog-sw-canvas').dialog({
          title: 'Street View',
          width: 1024,
          height: 768,
          closed: true,
          cache: false,
          modal: true,
          onClose: function(){
              $('#dialog-sw-canvas').empty();
          }
      });
  });
  </code></pre>
  
  <p>Everything works like a charm, but only once.</p>