     gridSize: 40
 
 renderResults = (search_results, last = true, callback) ->
-  $.each search_results, ->
+  total = search_results.length
+  $.each search_results, (index) ->
     [@id, @latitude, @longitude] = this if Object.isArray(this)
 
     latlng = new google.maps.LatLng(@latitude, @longitude)

        console.log('`window.print()` doesn’t prompt during development')
      else
        window.print()
    ).delay 1000
  else
    ready_to_print = true


      loadRelicInfo @id, (content) ->
        show_content_window(marker, content)

    # run callback on the last element in the last batch
    if index == total - 1 && last
      callback() if callback?


# Serialize form to JSON
$.fn.serializeObject = ->
