Skip to content

dshorthouse/simple-mappr

Repository files navigation

simple-mappr

Gem Version Gem Downloads Continuous Integration Status Dependency Status

Ruby Gem wrapper for the SimpleMappr API

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

Download and Installation

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.

Example 1

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:

SimpleMappr

Example 2

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

Example 3

require 'simple-mappr'
sm = SimpleMappr.new
sm.alive?

Returns true when the server is alive and ready.

License

SimpleMappr is released under the MIT license.

Support

Bug reports can be filed at https://github.com/dshorthouse/simple-mappr/issues.

Copyright

Authors: David P. Shorthouse

Copyright (c) 2016 David P. Shorthouse

About

Ruby gem wrapper for the SimpleMappr RESTful API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages