module Gobbler::Mappable::ClassMethods
Public Instance Methods
google_maps_url(opts = {})
click to toggle source
# File lib/gobbler/mappable.rb, line 16 def google_maps_url(opts = {}) opts[:size] ||= "1500x1200" opts[:sensor] ||= "true" url = "http://maps.googleapis.com/maps/api/staticmap?size=#{opts[:size]}" url += "&" + valid_locations.map {|c| "markers=color:green%7Clabel:X%7C#{c[0]},#{c[1]}"}.join("&") url += "&sensor=#{opts[:sensor]}" end
open_map!(opts = {})
click to toggle source
# File lib/gobbler/mappable.rb, line 24 def open_map!(opts = {}) system "open '#{google_maps_url(opts)}'" end
valid_locations()
click to toggle source
# File lib/gobbler/mappable.rb, line 14 def valid_locations; list.collect(&:coordinates).reject {|c| c == [nil,nil] || c == [0.0,0.0]}; end