simple-mappr 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3d4df13038ef314a5aaf18f1b2116bcbe2f6e79
4
- data.tar.gz: d02216d998e6044a020caef6bf61c722bab193df
3
+ metadata.gz: fb87eec8e32d398702a6d71f32528eb9b8630b1a
4
+ data.tar.gz: 2cba2dc3031aa2788b597aa27a5484703d34574b
5
5
  SHA512:
6
- metadata.gz: 71cf8807e91ae82f30fbb6ce74370afac5ab682970dc6102680708ca8f52f3e8474961956621c371293d7ea9efa26beb571e069fe49b40b71eb9cf100cc6d61f
7
- data.tar.gz: b513477e1368214fb13e1b1e9e0914ff48ee757eb9661811444c9d7a823e19f4c5497b31533d04d08824422d79678a47b894c674363dff2ae4c0ca2cd4b4b1c8
6
+ metadata.gz: 0bdfdd1c42034d7ac32e0dd73b2e2064a014cc81298d43b52aaec0dc93dfca95cb249eabb4029100599c75cb0a95b16be950ca73aa09c0a927fb533263a1b59b
7
+ data.tar.gz: 79b041227c2e17c2806de11427df7077796f5a2c2ebc7278946dea66f1d868d43239da0e8d346aac8d46774287a945b9a1641cf209ad861cfb5f76363bdf8468
@@ -146,6 +146,22 @@ class SimpleMappr
146
146
  @parameters[:height] || nil
147
147
  end
148
148
 
149
+ ##
150
+ # Show/hide graticule labels
151
+ #
152
+ # == Example
153
+ #
154
+ # instance.hide_gridlabel = true
155
+ #
156
+ def hide_gridlabel=(label)
157
+ Validator.validate_type(label, 'Boolean')
158
+ @parameters[:hide_gridlabel] = label
159
+ end
160
+
161
+ def hide_gridlabel
162
+ @parameters[:hide_gridlabel] || nil
163
+ end
164
+
149
165
  ##
150
166
  # Specify the layers to include in the image
151
167
  # Expressed as a comma-separated String without spaces
@@ -332,6 +348,23 @@ class SimpleMappr
332
348
  @parameters[:size] || nil
333
349
  end
334
350
 
351
+ ##
352
+ # Specify if shadow should be drawn under corresponding points
353
+ # Must be boolean
354
+ #
355
+ # == Example
356
+ #
357
+ # instance.shadow = [true,false]
358
+ #
359
+ def shadow=(shadow)
360
+ Validator.validate_shadows(shadow)
361
+ @parameters[:shadow] = shadow
362
+ end
363
+
364
+ def shadow
365
+ @parameters[:shadow] || nil
366
+ end
367
+
335
368
  ##
336
369
  # Specify the spacing between graticule (grid) lines in degrees
337
370
  # Must be an Integer less than or equal to 10
@@ -385,7 +418,7 @@ class SimpleMappr
385
418
 
386
419
  ##
387
420
  # Include wkt regions as an Array of Hashes
388
- # Specify color, title, and data as keys for each element
421
+ # Specify color, title, data, and border as keys for each element
389
422
  #
390
423
  # == Example
391
424
  #
@@ -12,7 +12,8 @@ class SimpleMappr
12
12
  'epsg:3112',
13
13
  'epsg:102017',
14
14
  'epsg:102019',
15
- 'epsg:54030'
15
+ 'epsg:54030',
16
+ 'epsg:3395'
16
17
  ]
17
18
 
18
19
  SHAPES = [
@@ -41,6 +42,7 @@ class SimpleMappr
41
42
  'reliefgrey',
42
43
  'stateprovinces',
43
44
  'stateprovnames',
45
+ 'us_counties',
44
46
  'lakes',
45
47
  'lakesOutline',
46
48
  'lakenames',
@@ -73,6 +73,11 @@ class SimpleMappr
73
73
  end
74
74
  end
75
75
 
76
+ def self.validate_shadows(data)
77
+ validate_type(data, 'Array')
78
+ data.each { |item| validate_type(item, 'Boolean') }
79
+ end
80
+
76
81
  def self.validate_url(data)
77
82
  validate_type(data, 'String')
78
83
  if data !~ /\A#{URI::regexp(['http', 'https'])}\z/
@@ -145,8 +150,8 @@ class SimpleMappr
145
150
  def self.validate_wkt(data)
146
151
  validate_type(data, 'Array')
147
152
  data.each { |item| validate_type(item, 'Hash') }
148
- if !(data[0].keys - [:data, :title, :color]).empty?
149
- raise InvalidParameterValue, "wkt must be an Array of Hashes in the form [{ data: \"\", title: \"\", color: \"\" }]"
153
+ if !(data[0].keys - [:data, :title, :color, :border]).empty?
154
+ raise InvalidParameterValue, "wkt must be an Array of Hashes in the form [{ data: \"\", title: \"\", color: \"\", border: \"\" }]"
150
155
  end
151
156
  if data[0].key?(:color)
152
157
  validate_color(data[0][:color])
@@ -1,5 +1,5 @@
1
1
  class SimpleMappr
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-mappr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-31 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client