0.0
No commit activity in last 3 years
No release in over 3 years
A gem to access the SimpleMappr API through basic methods
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 12.2
~> 3.4

Runtime

 Project Readme

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