title: Uncaught TypeError: Cannot set property 'position' of undefined
body: <p>I have this code giving me the strange error message</p>
  
  <pre><code>Uncaught TypeError: Cannot set property 'position' of undefined
  </code></pre>
  
  <p>This is the inside of a jQuery plugin to show a google map in a popup.
  I was using the code somewhere else, where it worked fine - the only difference here seems to be that I'm now using it in a Popup window. Am I missing a scope issue or something?
  All the variables like geocoderParams and latlng are filled like they should.
  Googling the the error message turned up nothing valuable.</p>
  
  <p>The error message gets fired when the google.maps.Map() is called.</p>
  
  <pre><code>self = $(this)
  self.hide()
  
  geocoder = new google.maps.Geocoder
  geocoderParams =
    address: self.data('address') || settings.address
    region: settings.region
  
  results = geocoder.geocode geocoderParams, (results, status) -&gt;
  
  if status == google.maps.GeocoderStatus.OK
    latlng = results[0].geometry.location
  
    mapOptions =
      mapTypeControl: false
      overviewMapControl: false
      zoom: settings.zoomLevel
      center: latlng
      mapTypeId: google.maps.MapTypeId.ROADMAP
  
    map = new google.maps.Map(self, mapOptions)
  
  self.show()
  </code></pre>