title: Google Maps Streetview. Object has no method panTo
body: <p>Hi I'm having a little trouble with the panTo method with google maps street view (V3 api). Console is reporting that it is undefined:</p>
  
  <p>Uncaught TypeError: Object # has no method 'panTo'</p>
  
  <p>I have set myPano (the variable used for my map object) as a global variable outside of the doc ready function. I can console log myPano and it's contents anywhere in my functions but no matter where I call panTo it returns the no method error. </p>
  
  <p>Is there an option I'm missing for adding the panTo method?</p>
  
  <p>Cribbed code:</p>
  
  <pre><code>var myPano; 
  
  jQuery(document).ready(function($) {
      google.maps.event.addDomListener(window, 'load', initialize(longVal, latVal));
  });
  
  function initialize(longVal, latVal) {
  
      mapPosition = new google.maps.LatLng(longVal, latVal);
      var panoramaOptions = {
          position: mapPosition,
          backgroundColor: 'black',
          pov: {
              heading: 0,
              pitch: 0
          },
          addressControl: false,
          zoom: 0,
          zoomControlOptions: {
              style: google.maps.ZoomControlStyle.SMALL
          }
      };
  
      myPano = new google.maps.StreetViewPanorama(
          document.getElementById('map-canvas'),
          panoramaOptions);
  
  }
  </code></pre>
  
  <p>Now with any functions I use to change panTo I get the error message. Even if I call the panTo method in the initialise function I get the same error. </p>
  
  <p>Does anyone have any ideas? Any help would be amazing. </p>
  
  <p>Cheers</p>