From 77cc4ce173dd2d7b74d46f5b7e3e6d055cbc5214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20B=C3=B6ning?= Date: Sun, 24 Oct 2010 04:13:40 +0200 Subject: [PATCH] filtering geocoded data before going into each-loop. now your columns are not counted if record is not geocoded. Otherwise it will throw an error if you start with an index wich is not zero. --- lib/seer/geomap.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/seer/geomap.rb b/lib/seer/geomap.rb index fbf7097..312bb17 100644 --- a/lib/seer/geomap.rb +++ b/lib/seer/geomap.rb @@ -90,8 +90,7 @@ def data_mode=(mode) #:nodoc: def data_table #:nodoc: @data_table = [] - data.each_with_index do |datum, column| - next unless datum.geocoded? + data.select{ |d| d.geocoded? }.each_with_index do |datum, column| if data_mode == "markers" @data_table << [ " data.setValue(#{column}, 0, #{datum.latitude});\r",