gull 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gull/polygon.rb +3 -2
- data/lib/gull/version.rb +1 -1
- data/spec/polygon_spec.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1038a8630e176b254970745e6c16c1ff032ff83c
|
4
|
+
data.tar.gz: 8cb441b6d8520162dc499f609bf789b9e2bd1ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b372492e761bccd98e13142c4944f9f9f114aa9571c82e3818c36925da3ff006fa7596b9ff4bda3d494aca4b07f551d88094be5ca17f4ccc95fd0038337d30
|
7
|
+
data.tar.gz: 0f6d47e866658c2523f7ec5d317decc8ea8ecef6e10a0c45992ee3628613100680c9c0a5e78a2d69f8a7815250f86b5f9391b6be8f654d3658173e31e1824f11
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
|
|
32
32
|
=> "http://maps.googleapis.com/maps/api/staticmap?size=640x640&maptype=roadmap&path=color:0xff0000|weight:3|fillcolor:0xff000060|38.73,-94.22|38.75,-94.16|38.57,-93.94|38.4,-93.84|38.4,-93.91|38.73,-94.22&key=your_api_key"
|
33
33
|
|
34
34
|
#options can be passed for map to override defaults
|
35
|
-
options = { :width => 600, :height => 300, :color => "0xfbf000", :weight => 4, :fillcolor => "0xfbf00070" }
|
35
|
+
options = { :width => 600, :height => 300, :color => "0xfbf000", :weight => 4, :fillcolor => "0xfbf00070", :maptype => "hybrid" }
|
36
36
|
|
37
37
|
alert.polygon.image_url "your_api_key", options
|
38
38
|
|
data/lib/gull/polygon.rb
CHANGED
@@ -37,11 +37,12 @@ module Gull
|
|
37
37
|
:height => 640,
|
38
38
|
:color => "0xff0000",
|
39
39
|
:weight => 3,
|
40
|
-
:fillcolor => "0xff000060"
|
40
|
+
:fillcolor => "0xff000060",
|
41
|
+
:maptype => "roadmap"
|
41
42
|
}.merge(options)
|
42
43
|
|
43
44
|
url_base = "http://maps.googleapis.com/maps/api/staticmap"
|
44
|
-
"#{url_base}?size=#{opts[:width]}x#{opts[:height]}&maptype
|
45
|
+
"#{url_base}?size=#{opts[:width]}x#{opts[:height]}&maptype=#{opts[:maptype]}&path=color:#{opts[:color]}" +
|
45
46
|
"|weight:#{opts[:weight]}|fillcolor:#{opts[:fillcolor]}|#{coordinates_piped}&key=#{api_key}"
|
46
47
|
end
|
47
48
|
|
data/lib/gull/version.rb
CHANGED
data/spec/polygon_spec.rb
CHANGED
@@ -12,10 +12,11 @@ describe Gull::Polygon do
|
|
12
12
|
polygon = Gull::Polygon.new "34.57,-97.56 34.77,-97.38 34.75,-97.17"
|
13
13
|
|
14
14
|
api_key = "testkey"
|
15
|
-
options = { :width => 600, :height => 300, :color => "0xfbf000", :weight => 4, :fillcolor => "0xfbf00070"
|
15
|
+
options = { :width => 600, :height => 300, :color => "0xfbf000", :weight => 4, :fillcolor => "0xfbf00070",
|
16
|
+
:maptype => "hybrid" }
|
16
17
|
url = polygon.image_url api_key, options
|
17
18
|
expected_url = "http://maps.googleapis.com/maps/api/staticmap?" +
|
18
|
-
"size=600x300&maptype=
|
19
|
+
"size=600x300&maptype=hybrid&path=color:0xfbf000" +
|
19
20
|
"|weight:4|fillcolor:0xfbf00070|34.57,-97.56|34.77,-97.38|34.75,-97.17&key=testkey"
|
20
21
|
expect(url).to eq expected_url
|
21
22
|
|