server-side-google-maps 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/server-side-google-maps/path.rb +2 -0
- data/lib/server-side-google-maps/version.rb +1 -1
- data/spec/path_spec.rb +14 -14
- metadata +3 -3
data/spec/path_spec.rb
CHANGED
@@ -84,12 +84,12 @@ module ServerSideGoogleMaps
|
|
84
84
|
p3 = Point.new(7.0, 1.0)
|
85
85
|
path = Path.new([p1, p2, p3])
|
86
86
|
interpolated = path.interpolate(8)
|
87
|
-
interpolated.length.should == 8
|
88
|
-
interpolated[0].should == p1
|
89
|
-
interpolated[6].latitude.to_s.should == '6.9936056564358' # too many decimals...
|
90
|
-
interpolated[6].longitude.should == 2.0
|
91
|
-
interpolated[6].distance_along_path.should == 666039
|
92
|
-
interpolated[7].should == p3
|
87
|
+
interpolated.points.length.should == 8
|
88
|
+
interpolated.points[0].should == p1
|
89
|
+
interpolated.points[6].latitude.to_s.should == '6.9936056564358' # too many decimals...
|
90
|
+
interpolated.points[6].longitude.should == 2.0
|
91
|
+
interpolated.points[6].distance_along_path.should == 666039
|
92
|
+
interpolated.points[7].should == p3
|
93
93
|
end
|
94
94
|
|
95
95
|
it('should work okay when duplicate Points are on the Path') do
|
@@ -99,11 +99,11 @@ module ServerSideGoogleMaps
|
|
99
99
|
p3 = Point.new(7.0, 1.0)
|
100
100
|
path = Path.new([p1, p2, p2_2, p3])
|
101
101
|
interpolated = path.interpolate(8)
|
102
|
-
interpolated[0].should == p1
|
103
|
-
interpolated[6].latitude.to_s.should == '6.9936056564358' # too many decimals...
|
104
|
-
interpolated[6].longitude.should == 2.0
|
105
|
-
interpolated[6].distance_along_path.should == 666039
|
106
|
-
interpolated[7].should == p3
|
102
|
+
interpolated.points[0].should == p1
|
103
|
+
interpolated.points[6].latitude.to_s.should == '6.9936056564358' # too many decimals...
|
104
|
+
interpolated.points[6].longitude.should == 2.0
|
105
|
+
interpolated.points[6].distance_along_path.should == 666039
|
106
|
+
interpolated.points[7].should == p3
|
107
107
|
end
|
108
108
|
|
109
109
|
it('should interpolate elevations') do
|
@@ -111,9 +111,9 @@ module ServerSideGoogleMaps
|
|
111
111
|
p2 = Point.new(2.0, 2.0, :elevation => 50)
|
112
112
|
path = Path.new([p1, p2])
|
113
113
|
interpolated = path.interpolate(5)
|
114
|
-
interpolated[0].elevation.should == 10
|
115
|
-
interpolated[1].elevation.should == 20
|
116
|
-
interpolated[4].elevation.should == 50
|
114
|
+
interpolated.points[0].elevation.should == 10
|
115
|
+
interpolated.points[1].elevation.should == 20
|
116
|
+
interpolated.points[4].elevation.should == 50
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: server-side-google-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Adam Hooper
|