Class: PrintMap::MapExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/print_map/map_exporter.rb

Instance Method Summary collapse

Instance Method Details

#export(opts = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/print_map/map_exporter.rb', line 6

def export(opts = {})
  service = opts[:service]
  query = {
    :bbox        => opts[:bbox],
    :f           => :image,
    :format      => :png24,
    :transparent => true,
    :size        => opts[:size],
    :dpi         => opts[:dpi]
  }
  response = HTTParty.get("#{service}/export", :query => query)
  Magick::Image.from_blob(response.body).first
end