Use simple-mappr to send structured, geographic data to the SimpleMappr API and receive either:
- a hash containing a URL to the map image and its expiry date, or
- a file to be downloaded
The latest version of SimpleMappr can be installed with RubyGems:
$ gem install simple-mappr
Source code can be downloaded on GitHub. See the public methods to learn all the setters.
require 'simple-mappr'
sm = SimpleMappr.new
sm.points = ['45,-120\n50,-110','47,-100']
sm.color = ['255,0,0','0,255,0']
sm.size = [12,14]
sm.shape = ['circle','triangle']
sm.layers = 'blueMarble'
sm.zoom = 4
sm.width = 450
sm.create
Returns a Hash:
{:imageURL=>"http://img.simplemappr.net/5792da8e_24f7_0.png", :expiry=>"2016-07-23T04:46:39-04:00"}
Corresponding to the image:
require 'simple-mappr'
sm = SimpleMappr.new
sm.points = ['45,-120\n50,-110','47,-100']
sm.output = 'svg'
sm.download("/tmp/my-map") # file title without extension
Downloads the image to /tmp/my-map.svg
require 'simple-mappr'
sm = SimpleMappr.new
sm.alive?
Returns true when the server is alive and ready.
SimpleMappr is released under the MIT license.
Bug reports can be filed at https://github.com/dshorthouse/simple-mappr/issues.
Authors: David P. Shorthouse
Copyright (c) 2016 David P. Shorthouse