title: TypeError: Gmaps.map is undefined
body: <p>@apneadiving: can please help me out</p>
  
  <p>Error showing in firebug</p>
  
  <p>TypeError: Gmaps.map is undefined</p>
  
  <p>Gmaps.map.callback = function() {</p>
  
  <p>I followed everything from <a href="http://andyglassblog.wordpress.com/2012/07/06/google-maps-for-rails-with-gmaps4-rails-tutorial-on-how-to-post-and-filter-locations/" rel="nofollow">Andy Glass tutorial</a> and stuck at this point
  In my output am able to see the google map and the markers with some details on clicking the marker.</p>
  
  <p>application.js</p>
  
  <pre><code> Gmaps.map.callback = function() {
  
          var PopulationFilter = {
              min: 800000,
              max: 10000000
          };
  
          $( "#filtered-pop" ).val( (PopulationFilter.min)+ " - " + (PopulationFilter.max))
          $("#population-range").slider({
              range: true,
              min: PopulationFilter.min,
              max: PopulationFilter.max,
              values: [ PopulationFilter.min, PopulationFilter.max ],
              slide: function(event, ui) {
                  $( "#filtered-pop" ).val( (ui.values[ 0 ])+ " - " + (ui.values[ 1 ]))
                  PopulationFilter.min = ui.values[ 0 ]
                  PopulationFilter.max = ui.values[ 1 ]
                  applyFilters()
              }
          });
  
          var VisibleMarkers = function() {
              var filtered = _.reject(Gmaps.map.markers, function(marker) {
                  return marker.prop_details &lt; PopulationFilter.min || marker.prop_details &gt; PopulationFilter.max;
              });
              return filtered
          }
  
          var applyFilters = function() {
              _.each(Gmaps.map.markers, function(marker) {
                  Gmaps.map.hideMarker(marker)
              })
              _.each(VisibleMarkers(), function(marker) {
                  Gmaps.map.showMarker(marker)
              })
          };
      }
  </code></pre>