Method: Nyaplot::MapPlot#before_to_json

Defined in:
lib/mapnya/plot.rb

#before_to_jsonObject



66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/mapnya/plot.rb', line 66

def before_to_json
  zoom(true)
  width(800) if width.nil?
  height(800) if height.nil?

  if map_data.nil?
    path = File.expand_path("../datasets/world.geo.json", __FILE__)
    map_data(JSON.parse(File.read(path)))
  end

  self.options[:axis_extra_options] = axis_extra_options
end