title: In an Ionic app, Google Maps only loads when page is refreshed, but not when coming from another page,
body: <p>I am trying to show a Google Maps street view in an Ionic app but am having troublegetting it work. When I go from another page to this page, it doesn't load. But I refresh this current page, then the street view works. Any idea on how to fix this?</p>
  
  <p>controllers.js</p>
  
  <pre><code>.controller('StreetviewCtrl', function($scope, $ionicLoading, $state, $stateParams){
      console.log('Street view page loaded');
  
      Parse.initialize("xyz", "xyz");
  
    //Load the Goog map
      $scope.initialise = function() {
  
      console.log('initialize function');
  
      var myLatlng = new google.maps.LatLng(40.758774,  -73.98504);
  
          var mapOptions = {
              center: myLatlng,
              zoom: 1,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          };
  
          var map = new google.maps.Map(document.getElementById("street"), mapOptions);
  
          var panoramaOptions = {
              position: myLatlng,
              addressControl: false,
              pov: {
                  heading: 34,
                  pitch: 10
              }
          };
  
          var panorama = new google.maps.StreetViewPanorama(document.getElementById('street'), panoramaOptions);
  
        $scope.map=panorama;
  
      };
  
      google.maps.event.addDomListener(document.getElementById("street"), 'load', $scope.initialise());
  
  
      //Go to the guessing page
      $scope.makeGuess = function(item,event){
          console.log('guess button tapped');
          // $state.go('tab.account');
      };
  
  
  })
  </code></pre>
  
  <p>template (streetview.html)</p>
  
  <pre><code>&lt;ion-view title="Where are you?"&gt;
    &lt;ion-content class="padding"&gt;
  
      &lt;center&gt;
          &lt;button on-touch="makeGuess()" class="button button-full button-positive"&gt;
              Make a Guess &lt;i class="ion-arrow-right-a"&gt;&lt;/i&gt;
          &lt;/button&gt;
      &lt;/center&gt;
  
      &lt;div id="street" data-tap-disabled="false"&gt;&lt;/div&gt;
  
    &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>