Skip to content

Commit

Permalink
filtering geocoded data before going into each-loop. now your columns…
Browse files Browse the repository at this point in the history
… are not counted if record is not geocoded. Otherwise it will throw an error if you start with an index wich is not zero.
  • Loading branch information
robinboening committed Oct 24, 2010
1 parent 1620ddd commit 77cc4ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/seer/geomap.rb
Expand Up @@ -90,8 +90,7 @@ def data_mode=(mode) #:nodoc:


def data_table #:nodoc: def data_table #:nodoc:
@data_table = [] @data_table = []
data.each_with_index do |datum, column| data.select{ |d| d.geocoded? }.each_with_index do |datum, column|
next unless datum.geocoded?
if data_mode == "markers" if data_mode == "markers"
@data_table << [ @data_table << [
" data.setValue(#{column}, 0, #{datum.latitude});\r", " data.setValue(#{column}, 0, #{datum.latitude});\r",
Expand Down

0 comments on commit 77cc4ce

Please sign in to comment.