server-side-google-maps 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,8 @@ module ServerSideGoogleMaps
75
75
  end
76
76
 
77
77
  ret << create_interpolated_point(points[-1], points[-1], 0.0, :distance_along_path => points[-1].distance_along_path)
78
+
79
+ Path.new(ret)
78
80
  end
79
81
 
80
82
  def simplify(latlng_error2)
@@ -1,3 +1,3 @@
1
1
  module ServerSideGoogleMaps
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Hooper