server-side-google-maps 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/AUTHORS +1 -0
- data/Gemfile +8 -0
- data/LICENSE +3 -0
- data/README.md +48 -0
- data/Rakefile +2 -0
- data/bin/autospec +16 -0
- data/bin/htmldiff +16 -0
- data/bin/httparty +16 -0
- data/bin/ldiff +16 -0
- data/bin/rspec +16 -0
- data/lib/server-side-google-maps.rb +11 -0
- data/lib/server-side-google-maps/directions.rb +137 -0
- data/lib/server-side-google-maps/geo_math.rb +24 -0
- data/lib/server-side-google-maps/route.rb +53 -0
- data/lib/server-side-google-maps/server.rb +13 -0
- data/lib/server-side-google-maps/version.rb +3 -0
- data/server-side-google-maps.gemspec +24 -0
- data/spec/directions_spec.rb +122 -0
- data/spec/files/directions-45.5086700,-73.5536800-to-45.4119000,-75.6984600.txt +344 -0
- data/spec/files/directions-Montreal,QC-to-Ottawa,ON.txt +344 -0
- data/spec/files/directions-Ottawa,ON-to-Toronto,ON.txt +344 -0
- data/spec/route_spec.rb +98 -0
- data/spec/spec.rb +3 -0
- metadata +124 -0
@@ -0,0 +1,122 @@
|
|
1
|
+
require 'spec'
|
2
|
+
|
3
|
+
module ServerSideGoogleMaps
|
4
|
+
describe(Directions) do
|
5
|
+
describe('#get') do
|
6
|
+
it('should use proper URL') do
|
7
|
+
Server.should_receive(:get).with('/maps/api/directions/json', :query => { :origin => 'Montreal,QC', :destination => 'Ottawa,ON', :sensor => false })
|
8
|
+
Directions.get(:origin => 'Montreal,QC', :destination => 'Ottawa,ON')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe('#initialize') do
|
13
|
+
it('should query with :origin and :destination when given strings') do
|
14
|
+
Directions.should_receive(:get).with(:origin => 'Montreal,QC', :destination => 'Ottawa,ON', :mode => :driving)
|
15
|
+
Directions.new('Montreal,QC', 'Ottawa,ON')
|
16
|
+
end
|
17
|
+
|
18
|
+
it('should query with :origin and :destination when given points') do
|
19
|
+
Directions.should_receive(:get).with(:origin => '45.50867,-73.55368', :destination => '45.4119,-75.69846', :mode => :driving)
|
20
|
+
Directions.new([45.5086700,-73.5536800], [45.4119000,-75.6984600])
|
21
|
+
end
|
22
|
+
|
23
|
+
it('should pass :mode') do
|
24
|
+
Directions.should_receive(:get).with(:origin => '1', :destination => '2', :mode => :bicycling)
|
25
|
+
Directions.new('1', '2', :mode => :bicycling)
|
26
|
+
end
|
27
|
+
|
28
|
+
it('should not query Google with :direct and lat-lng string inputs') do
|
29
|
+
Directions.should_not_receive(:get)
|
30
|
+
Directions.new('45.5086700,-73.5536800', '45.4119000,-75.6984600', :mode => :direct)
|
31
|
+
end
|
32
|
+
|
33
|
+
it('should not query Google with :direct and lat-lng inputs') do
|
34
|
+
Directions.should_not_receive(:get)
|
35
|
+
Directions.new([45.5086700,-73.5536800], [45.4119000,-75.6984600], :mode => :direct)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context('with lat-lng string inputs and :mode => :direct') do
|
40
|
+
it('should calculate proper distance') do
|
41
|
+
directions = Directions.new('45.5086700,-73.5536800', '45.4119000,-75.6984600', :mode => :direct)
|
42
|
+
directions.distance.should == 167512
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context('with a mocked return value') do
|
47
|
+
class Parser < HTTParty::Parser
|
48
|
+
public_class_method(:new)
|
49
|
+
end
|
50
|
+
|
51
|
+
before(:each) do
|
52
|
+
Directions.stub(:get) do
|
53
|
+
data = File.read(File.dirname(__FILE__) + '/files/directions-Montreal,QC-to-Ottawa,ON.txt')
|
54
|
+
parser = Parser.new(data, :json)
|
55
|
+
parser.parse
|
56
|
+
end
|
57
|
+
|
58
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
59
|
+
end
|
60
|
+
|
61
|
+
it('should have origin_input and destination_input') do
|
62
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
63
|
+
directions.origin_input.should == 'Montreal,QC'
|
64
|
+
directions.destination_input.should == 'Ottawa,ON'
|
65
|
+
end
|
66
|
+
|
67
|
+
it('should have (server-supplied) origin_address and destination_input') do
|
68
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
69
|
+
directions.origin_address.should == 'Montreal, QC, Canada'
|
70
|
+
directions.destination_address.should == 'Ottawa, ON, Canada'
|
71
|
+
end
|
72
|
+
|
73
|
+
it('should have origin_point and destination_point') do
|
74
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
75
|
+
directions.origin_point.should == [ 45.5086700, -73.5536800 ]
|
76
|
+
directions.destination_point.should == [ 45.4119000, -75.6984600 ]
|
77
|
+
end
|
78
|
+
|
79
|
+
it('should have an "OK" status') do
|
80
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
81
|
+
directions.status.should == 'OK'
|
82
|
+
end
|
83
|
+
|
84
|
+
it('should have the proper points') do
|
85
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
86
|
+
points = directions.points
|
87
|
+
points.length.should == 138
|
88
|
+
points[0].should == [45.50867, -73.55368]
|
89
|
+
points[1].should == [45.50623, -73.55569]
|
90
|
+
points[-1].should == [45.4119, -75.69846]
|
91
|
+
end
|
92
|
+
|
93
|
+
it('should have the proper distance') do
|
94
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON')
|
95
|
+
distance = directions.distance
|
96
|
+
distance.should == 199901
|
97
|
+
end
|
98
|
+
|
99
|
+
it('should suggest a straight line, with :direct') do
|
100
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON', :mode => :direct)
|
101
|
+
directions.points.should == [[45.50867, -73.55368], [45.4119, -75.69846]]
|
102
|
+
directions.distance.should == 167512
|
103
|
+
end
|
104
|
+
|
105
|
+
it('should suggest normal route if :find_shortcuts shortcuts are not short enough') do
|
106
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON', :find_shortcuts => [{ :factor => 0.5, :mode => :direct }])
|
107
|
+
directions.points.length.should > 2
|
108
|
+
directions.distance.should == 199901
|
109
|
+
end
|
110
|
+
|
111
|
+
it('should suggest a shortcut if :find_shortcuts finds a shortcut') do
|
112
|
+
directions = Directions.new('Montreal,QC', 'Ottawa,ON', :find_shortcuts => [{ :factor => 0.95, :mode => :direct }])
|
113
|
+
directions.points.length.should == 2
|
114
|
+
directions.distance.should == 167512
|
115
|
+
end
|
116
|
+
|
117
|
+
it('should correct the user if :find_shortcuts is not an Array') do
|
118
|
+
lambda { Directions.new('Montreal,QC', 'Ottawa,ON', :find_shortcuts => { :factor => 0.5, :mode => :direct }) }.should(raise_error(ArgumentError))
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
@@ -0,0 +1,344 @@
|
|
1
|
+
{
|
2
|
+
"status": "OK",
|
3
|
+
"routes": [ {
|
4
|
+
"summary": "Autoroute 40 W and ON-417 W",
|
5
|
+
"legs": [ {
|
6
|
+
"steps": [ {
|
7
|
+
"travel_mode": "DRIVING",
|
8
|
+
"start_location": {
|
9
|
+
"lat": 45.5086700,
|
10
|
+
"lng": -73.5536800
|
11
|
+
},
|
12
|
+
"end_location": {
|
13
|
+
"lat": 45.5062300,
|
14
|
+
"lng": -73.5556900
|
15
|
+
},
|
16
|
+
"polyline": {
|
17
|
+
"points": "elwtGn}|_MfNpK",
|
18
|
+
"levels": "BB"
|
19
|
+
},
|
20
|
+
"duration": {
|
21
|
+
"value": 20,
|
22
|
+
"text": "1 min"
|
23
|
+
},
|
24
|
+
"html_instructions": "Head \u003cb\u003esouthwest\u003c/b\u003e on \u003cb\u003eRue Notre-Dame E\u003c/b\u003e toward \u003cb\u003ePlace Jacques Cartier\u003c/b\u003e",
|
25
|
+
"distance": {
|
26
|
+
"value": 313,
|
27
|
+
"text": "0.3 km"
|
28
|
+
}
|
29
|
+
}, {
|
30
|
+
"travel_mode": "DRIVING",
|
31
|
+
"start_location": {
|
32
|
+
"lat": 45.5062300,
|
33
|
+
"lng": -73.5556900
|
34
|
+
},
|
35
|
+
"end_location": {
|
36
|
+
"lat": 45.5068900,
|
37
|
+
"lng": -73.5572800
|
38
|
+
},
|
39
|
+
"polyline": {
|
40
|
+
"points": "}|vtG`j}_McC|H",
|
41
|
+
"levels": "BB"
|
42
|
+
},
|
43
|
+
"duration": {
|
44
|
+
"value": 25,
|
45
|
+
"text": "1 min"
|
46
|
+
},
|
47
|
+
"html_instructions": "Take the 1st \u003cb\u003eright\u003c/b\u003e onto \u003cb\u003eBoulevard Saint-Laurent\u003c/b\u003e",
|
48
|
+
"distance": {
|
49
|
+
"value": 144,
|
50
|
+
"text": "0.1 km"
|
51
|
+
}
|
52
|
+
}, {
|
53
|
+
"travel_mode": "DRIVING",
|
54
|
+
"start_location": {
|
55
|
+
"lat": 45.5068900,
|
56
|
+
"lng": -73.5572800
|
57
|
+
},
|
58
|
+
"end_location": {
|
59
|
+
"lat": 45.5082100,
|
60
|
+
"lng": -73.5563400
|
61
|
+
},
|
62
|
+
"polyline": {
|
63
|
+
"points": "aawtG~s}_MgG{D",
|
64
|
+
"levels": "BB"
|
65
|
+
},
|
66
|
+
"duration": {
|
67
|
+
"value": 40,
|
68
|
+
"text": "1 min"
|
69
|
+
},
|
70
|
+
"html_instructions": "Take the 1st \u003cb\u003eright\u003c/b\u003e onto \u003cb\u003eRue Saint Antoine E\u003c/b\u003e",
|
71
|
+
"distance": {
|
72
|
+
"value": 164,
|
73
|
+
"text": "0.2 km"
|
74
|
+
}
|
75
|
+
}, {
|
76
|
+
"travel_mode": "DRIVING",
|
77
|
+
"start_location": {
|
78
|
+
"lat": 45.5082100,
|
79
|
+
"lng": -73.5563400
|
80
|
+
},
|
81
|
+
"end_location": {
|
82
|
+
"lat": 45.5071400,
|
83
|
+
"lng": -73.5585500
|
84
|
+
},
|
85
|
+
"polyline": {
|
86
|
+
"points": "iiwtGbn}_MuA]g@P}@xBAn@^d@fHnEjAd@",
|
87
|
+
"levels": "B???@??B"
|
88
|
+
},
|
89
|
+
"duration": {
|
90
|
+
"value": 61,
|
91
|
+
"text": "1 min"
|
92
|
+
},
|
93
|
+
"html_instructions": "Take the \u003cb\u003eAutoroute 720 O\u003c/b\u003e ramp on the \u003cb\u003eleft\u003c/b\u003e",
|
94
|
+
"distance": {
|
95
|
+
"value": 404,
|
96
|
+
"text": "0.4 km"
|
97
|
+
}
|
98
|
+
}, {
|
99
|
+
"travel_mode": "DRIVING",
|
100
|
+
"start_location": {
|
101
|
+
"lat": 45.5071400,
|
102
|
+
"lng": -73.5585500
|
103
|
+
},
|
104
|
+
"end_location": {
|
105
|
+
"lat": 45.4728800,
|
106
|
+
"lng": -73.5967400
|
107
|
+
},
|
108
|
+
"polyline": {
|
109
|
+
"points": "sbwtG|{}_M`TtPjMlIpCnAz@TvJ`@dBXjC`AfBjAfA`AzAtB~@fBr@lBtHhYvClH|DbG~StYrHhLvSj`@|_@~r@lEjErF|BdU`H",
|
110
|
+
"levels": "B?@??????@????@??@?@??B"
|
111
|
+
},
|
112
|
+
"duration": {
|
113
|
+
"value": 202,
|
114
|
+
"text": "3 mins"
|
115
|
+
},
|
116
|
+
"html_instructions": "Merge onto \u003cb\u003eAutoroute 720 W\u003c/b\u003e",
|
117
|
+
"distance": {
|
118
|
+
"value": 5006,
|
119
|
+
"text": "5.0 km"
|
120
|
+
}
|
121
|
+
}, {
|
122
|
+
"travel_mode": "DRIVING",
|
123
|
+
"start_location": {
|
124
|
+
"lat": 45.4728800,
|
125
|
+
"lng": -73.5967400
|
126
|
+
},
|
127
|
+
"end_location": {
|
128
|
+
"lat": 45.5019000,
|
129
|
+
"lng": -73.6638100
|
130
|
+
},
|
131
|
+
"polyline": {
|
132
|
+
"points": "olptGrje`MPPrD~A|A|AtAhBhAdC~@`Dv@nGFjEIzAg@nDiAnEeFnPsDpKeA~ByKx[uEjKoErIaCdDwGzFaClC{AbCyAjDmJ~WcJrXqItUiFrOOLwWrv@uGlSGp@eDtKqA|CeZbj@QHyG~LqApBuCnD{DjD",
|
133
|
+
"levels": "B???@??@????@???@?????@?????????@?????B"
|
134
|
+
},
|
135
|
+
"duration": {
|
136
|
+
"value": 378,
|
137
|
+
"text": "6 mins"
|
138
|
+
},
|
139
|
+
"html_instructions": "Take exit \u003cb\u003e1N\u003c/b\u003e to merge onto \u003cb\u003eAutoroute Décarie/Autoroute 15 N\u003c/b\u003e toward \u003cb\u003eSaint-Jérôme\u003c/b\u003e",
|
140
|
+
"distance": {
|
141
|
+
"value": 6611,
|
142
|
+
"text": "6.6 km"
|
143
|
+
}
|
144
|
+
}, {
|
145
|
+
"travel_mode": "DRIVING",
|
146
|
+
"start_location": {
|
147
|
+
"lat": 45.5019000,
|
148
|
+
"lng": -73.6638100
|
149
|
+
},
|
150
|
+
"end_location": {
|
151
|
+
"lat": 45.5026400,
|
152
|
+
"lng": -73.6676900
|
153
|
+
},
|
154
|
+
"polyline": {
|
155
|
+
"points": "{avtGxmr`McAz@uFdDsAlBa@~A@xBXlA\\n@VXl@XzCj@",
|
156
|
+
"levels": "B???@??@??B"
|
157
|
+
},
|
158
|
+
"duration": {
|
159
|
+
"value": 30,
|
160
|
+
"text": "1 min"
|
161
|
+
},
|
162
|
+
"html_instructions": "Take exit \u003cb\u003e70O\u003c/b\u003e on the \u003cb\u003eleft\u003c/b\u003e for \u003cb\u003eAutoroute 40 O\u003c/b\u003e toward \u003cb\u003eHull/Ottawa/Autoroute 520/Pierre Elliott Trudeau\u003c/b\u003e",
|
163
|
+
"distance": {
|
164
|
+
"value": 542,
|
165
|
+
"text": "0.5 km"
|
166
|
+
}
|
167
|
+
}, {
|
168
|
+
"travel_mode": "DRIVING",
|
169
|
+
"start_location": {
|
170
|
+
"lat": 45.5026400,
|
171
|
+
"lng": -73.6676900
|
172
|
+
},
|
173
|
+
"end_location": {
|
174
|
+
"lat": 45.5390400,
|
175
|
+
"lng": -74.3889100
|
176
|
+
},
|
177
|
+
"polyline": {
|
178
|
+
"points": "ofvtG`fs`MxAp@|AvAjXl^xEfHhAxBxA`Ep@hCl@dDn@bHNvF`@xl@ZvIt@xIfBdLlCfMdA~DtQnz@nAbIl@hG`@~JEpNsIrsDWfOAzN\\tVpB~t@b@pWfAla@d@tHrAfMhBfKlBbIlDzKni@bvAxl@|~A~gAlnCzR|f@pBvGn@lC~AbJjQduAnAdHfBbHrFhOx}@r~BvFlOvAnEfCxIhChKfEpT`J`l@nArGxChMxAlErBzFlG`Od[rs@xRdc@rOf^`C`FhBdFnBpIv@bHT|DPfHMzGeG`hBiCzp@a@xM@bHlQzyEvEpp@vArWnB|UjEpl@l@pGnBtMhD`OrBnGfNl_@vD`Jzh@btA|DzKlGnWjA`JN`GC`Dc@hGiBtI{AzDeC`EcBhBsCbCy@f@k^tYcSnQi{@r_AsChEg@fAgAlCeBhGs@bEc@rEaCzl@_@lTwAb{AWlGiAtKw@rDwChK_p@tvBiB|GwAvIw@xH[`JCvJ~DhhAT|PAhp@YpIuAnSmBxNyLht@iEhRaEbNuBrFgExJ{IpP}d@f~@m`@~p@qL~T}EpM}\\pmAcRnh@gQ`t@uBjLa\\`vCiAfFsAvD}D~GuR|VmR~U{CvF{CpI_Jfh@gL|s@q@xGUvFDbJpOxfDKhGc@`FqBpIwCfGkzA|kBgJvLeg@pr@wC|CkAbAuF~C_DfAgdBbe@mDd@yC?qHo@{C@cEz@wCpA}DdDaE|G{AtEsGj`@",
|
179
|
+
"levels": "B??@???@?????@?????A????@???@??A???@?@?????@???@??????@???????A???@???@@???A???@???@???A???@????@@???A??????@??@??@????@???A???@????@??@??@????@??A??@@??A????@???@???@?@?@?B"
|
180
|
+
},
|
181
|
+
"duration": {
|
182
|
+
"value": 2666,
|
183
|
+
"text": "44 mins"
|
184
|
+
},
|
185
|
+
"html_instructions": "Merge onto \u003cb\u003eAutoroute 40 W\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003eEntering Ontario\u003c/div\u003e",
|
186
|
+
"distance": {
|
187
|
+
"value": 66555,
|
188
|
+
"text": "66.6 km"
|
189
|
+
}
|
190
|
+
}, {
|
191
|
+
"travel_mode": "DRIVING",
|
192
|
+
"start_location": {
|
193
|
+
"lat": 45.5390400,
|
194
|
+
"lng": -74.3889100
|
195
|
+
},
|
196
|
+
"end_location": {
|
197
|
+
"lat": 45.4124300,
|
198
|
+
"lng": -75.6833000
|
199
|
+
},
|
200
|
+
"polyline": {
|
201
|
+
"points": "_j}tGta`eMoRzmAab@vcCu\\|nCuF~]uThiAeE~VyR`wAcSfzA}AjLgA|J[|FK|FTpHp@nIfApGtBxHvBrFfGtIfj@`l@fHjJfGzJhKrVdSzs@pD|KdHxOfGdKvF`IxcAbmAtJ~IvJrH|GfEbb@nUpn@v\\tIpHnClDxCfF|ChHzBdHxD|TvMt`AbD`QbD`M`ElNxHzSnPl_@xGlRnCjJpBdIpJdd@pE`RfGfTjIpTnVzj@pFrObErNhFjU~E~[~D~_@nDbXlGdX|HbSbJjQnMdUlGlNhFnN~I`YzBhGzF|MxEpJlFnJ~JbOlOnPjOhNvLjLlFxHzEdJjFhN`D|LzDpUpAhVjAf]~@jNvB~PlC~NxDvN|DxKzFxMfG`Kt^bd@pF`IxEbIxIpQnSbk@hJzTpGbMpIdNfNzPdMfM`JrG|IhFzP|GfRbEj^zCnUtF~IhDvHjEjNjKjKxKvKnN|FtJ~FvLt^l}@bGnRtEpSjBfLdClUpAbSx@|b@n@`g@`AbTbDd^tDhUpDjQrFlSjSjk@bHhTvJh_@bGpXhH~]xGvWfOrg@vJfWpIjPvI`LvIpHbKrGxNrIdG~DfGpFvF|FlEtFvFhIfDfGlEhKxBfGhSlo@fe@`~A~H`[lEnXfCjXz@rV?fZc@dj@Zpc@fAt_@~B`c@nCj\\z]jtDv@zGnC~QzDrRrDrN~R|p@|Qxr@lQhy@rTbiAzEjYrEh^|A`ObD~`@vAvXf@bQxBpi@r@tM`@~LR~JBxJKtKg@dLk@rIy@rH}@bHeCnNaBzKcAdIy@bJmAvQk@lTCvTf@fT`ArPjCdYrBxQ~@lUMzToBhVqEfUwEhPcJtQkKlOmUp[cCvDuC~FqCnHaClJWxAyAlLk@xNRlLb@tJbDtg@nBte@`Cpz@fCzc@fJpfAp@~MXnPk@pZoAlQgDhY}@dJc@fNH~Kd@pK`F|y@d@`R?pIQvM{@tPuAjNsCbR_ElPcDjKeGhOuGlLio@x~@iDzFyDxI_CjHeAbE}BhNy@pI_@|HKdK?n_@K~I[dJkAvPeBxNuCvOwCrLeIlZ_DzOu@|EqAxKw@`Ke@lJS|ICdKlBxaC@vLMrQQ`JkArY_A|MeBfRiK`x@mDv\\kh@hzFaFxv@sIn}AcFp{@m@vGsAdJoAjGeBxGgCdIop@j_BmBnG}@zDu@vE]zC[~EmIxnBeF|gAiBb\\yBn\\aEne@}e@v_FwBlNiA|EoBvGsBlFyA|CmDfG}OdTgFhI}EnJwKpWkBtDwDnGoGhIeE`EoDvCiHjE{F`CiGhBkHpAyF^}Oj@qC`@kDz@yChAeFtCsNxK_C~AeCrAkE~AqMdDeBx@aBfA{BxBsAfBkCdFoArDcArFk@lGq@zKk@rE}@fEcAdDkBzDqCtD_CpBkBjAgBr@eCn@mM~AqAf@sBnAwBlB{B|C_B`EsA|FS~AYvFDrEZhE^fCrEdRfBdJvA~JjAhMt@vRnEr`Bb@lIXxCh@~CjE|Pd@vCZhDnB`k@ExE{@xLOxEF`GP|Cz@rGpAhFrQdg@rEnQ",
|
202
|
+
"levels": "B?@@??@?@???@??A??@??@??@??@?@???@??A?@???@???@????@???@????@???@????@?@??@??@?@???@???A???@??@??@??@?@?@??@??@?A???@???@?@???@????A??@????@???@????A??@??@?@?@??@??@?@????B??????@???????@??@?????A??@????@??@?A????????@????@???@???A???@??@???A??????@????@???@???@??@????@??@????@???@?????@??A???@???????@???@?????@????@???@???@??????@??@????@???A???@????@??@????@?????@???B"
|
203
|
+
},
|
204
|
+
"duration": {
|
205
|
+
"value": 4744,
|
206
|
+
"text": "1 hour 19 mins"
|
207
|
+
},
|
208
|
+
"html_instructions": "Continue onto \u003cb\u003eON-417 W\u003c/b\u003e",
|
209
|
+
"distance": {
|
210
|
+
"value": 118628,
|
211
|
+
"text": "119 km"
|
212
|
+
}
|
213
|
+
}, {
|
214
|
+
"travel_mode": "DRIVING",
|
215
|
+
"start_location": {
|
216
|
+
"lat": 45.4124300,
|
217
|
+
"lng": -75.6833000
|
218
|
+
},
|
219
|
+
"end_location": {
|
220
|
+
"lat": 45.4112800,
|
221
|
+
"lng": -75.6874000
|
222
|
+
},
|
223
|
+
"polyline": {
|
224
|
+
"points": "urdtGr{|lMNzAvAjGf@fFtAbF",
|
225
|
+
"levels": "B???B"
|
226
|
+
},
|
227
|
+
"duration": {
|
228
|
+
"value": 27,
|
229
|
+
"text": "1 min"
|
230
|
+
},
|
231
|
+
"html_instructions": "Take exit \u003cb\u003e119\u003c/b\u003e for \u003cb\u003eCatherine Street\u003c/b\u003e",
|
232
|
+
"distance": {
|
233
|
+
"value": 346,
|
234
|
+
"text": "0.3 km"
|
235
|
+
}
|
236
|
+
}, {
|
237
|
+
"travel_mode": "DRIVING",
|
238
|
+
"start_location": {
|
239
|
+
"lat": 45.4112800,
|
240
|
+
"lng": -75.6874000
|
241
|
+
},
|
242
|
+
"end_location": {
|
243
|
+
"lat": 45.4088400,
|
244
|
+
"lng": -75.6937300
|
245
|
+
},
|
246
|
+
"polyline": {
|
247
|
+
"points": "okdtGfu}lM|@jF`AjDfJxY",
|
248
|
+
"levels": "B??B"
|
249
|
+
},
|
250
|
+
"duration": {
|
251
|
+
"value": 108,
|
252
|
+
"text": "2 mins"
|
253
|
+
},
|
254
|
+
"html_instructions": "Slight \u003cb\u003eleft\u003c/b\u003e at \u003cb\u003eCatherine St/Regional Road 60\u003c/b\u003e",
|
255
|
+
"distance": {
|
256
|
+
"value": 565,
|
257
|
+
"text": "0.6 km"
|
258
|
+
}
|
259
|
+
}, {
|
260
|
+
"travel_mode": "DRIVING",
|
261
|
+
"start_location": {
|
262
|
+
"lat": 45.4088400,
|
263
|
+
"lng": -75.6937300
|
264
|
+
},
|
265
|
+
"end_location": {
|
266
|
+
"lat": 45.4125400,
|
267
|
+
"lng": -75.6968900
|
268
|
+
},
|
269
|
+
"polyline": {
|
270
|
+
"points": "g|ctGx|~lMU^}ElDoNhL",
|
271
|
+
"levels": "B??B"
|
272
|
+
},
|
273
|
+
"duration": {
|
274
|
+
"value": 56,
|
275
|
+
"text": "1 min"
|
276
|
+
},
|
277
|
+
"html_instructions": "Turn \u003cb\u003eright\u003c/b\u003e at \u003cb\u003eKent St/Hwy 17B/Regional Road 83\u003c/b\u003e",
|
278
|
+
"distance": {
|
279
|
+
"value": 480,
|
280
|
+
"text": "0.5 km"
|
281
|
+
}
|
282
|
+
}, {
|
283
|
+
"travel_mode": "DRIVING",
|
284
|
+
"start_location": {
|
285
|
+
"lat": 45.4125400,
|
286
|
+
"lng": -75.6968900
|
287
|
+
},
|
288
|
+
"end_location": {
|
289
|
+
"lat": 45.4119000,
|
290
|
+
"lng": -75.6984600
|
291
|
+
},
|
292
|
+
"polyline": {
|
293
|
+
"points": "ksdtGpp_mM~BxH",
|
294
|
+
"levels": "BB"
|
295
|
+
},
|
296
|
+
"duration": {
|
297
|
+
"value": 38,
|
298
|
+
"text": "1 min"
|
299
|
+
},
|
300
|
+
"html_instructions": "Turn \u003cb\u003eleft\u003c/b\u003e at \u003cb\u003eJames St\u003c/b\u003e",
|
301
|
+
"distance": {
|
302
|
+
"value": 142,
|
303
|
+
"text": "0.1 km"
|
304
|
+
}
|
305
|
+
} ],
|
306
|
+
"duration": {
|
307
|
+
"value": 8395,
|
308
|
+
"text": "2 hours 20 mins"
|
309
|
+
},
|
310
|
+
"distance": {
|
311
|
+
"value": 199900,
|
312
|
+
"text": "200 km"
|
313
|
+
},
|
314
|
+
"start_location": {
|
315
|
+
"lat": 45.5086700,
|
316
|
+
"lng": -73.5536800
|
317
|
+
},
|
318
|
+
"end_location": {
|
319
|
+
"lat": 45.4119000,
|
320
|
+
"lng": -75.6984600
|
321
|
+
},
|
322
|
+
"start_address": "510 Rue Gosford, Montreal, QC H2Y 3Z2, Canada",
|
323
|
+
"end_address": "105 James St, Ottawa, ON K1R 5X1, Canada",
|
324
|
+
"via_waypoint": [ ]
|
325
|
+
} ],
|
326
|
+
"copyrights": "Map data ©2011 Google",
|
327
|
+
"overview_polyline": {
|
328
|
+
"points": "elwtGn}|_MfNpKcC|H}IyE}AlEvn@lc@f^pJ|Sbm@fyAndCli@|U~IbSo@dTg\\xaAqb@rp@soAhuDah@t_AeWdXrt@bdA`FlxAn_@jnBsIngFbHdyCxMnp@fuDzoJb^j}B|oAzeD~b@bvBpvAxgDpAd`@oLzqDlQzyEjRtmCzLxn@xcAnlCdJto@oJ|]a|@zt@i{@r_AiJhTsLh`Ei~@bfDrDjbDwSdcBiUzt@weBjfDibAblDab@tjDqs@ldAc\\vgBaAtZpOxfDaD|XuyCp|D}pBjl@y]r@wOtOibC|kO{i@t_EyAjd@fJnc@~cA~mA`e@lxAdX`f@noAbxAjfBbcA~RfUrf@fiCdi@dwAla@`bBpn@t`Bfa@teCzoAnwC~`AxhAtThc@|Inc@tI|uA`Wjz@hu@jdAri@psAja@dn@dc@d]~yArZbc@`W``@~f@tf@dkAjUvjA|FftBxInt@|_BvaG``@tu@bv@ji@dZda@xmAb_EpKniA~DvnDjb@vqErfBtbItMjpAbJb~BsT|{CdL`_C}Bdl@iLpf@iw@noA_K|p@n^n~GkJfsBvHpfBmA~i@sYroAi}@btA}Nrh@yEbhB_b@vdCS~~Ei_AhsJyWzqE_Mhn@qw@ntBqYf~Fmm@tlGqM`d@}aAhcBg`@bVsq@nIc|@bd@sKfR{Lzs@}JrJg\\zIuKjWfOrpAhHx~BpIxd@jA`wAnr@fgCcVvR~BxH",
|
329
|
+
"levels": "B@@@@@@@@@A@@@@@A@@A@A@@@@@A@@@A@@B@@@A@@@A@@@@@A@@AA@@A@@B@@@@@@A@@@@@@@@@@A@@@@@@@A@@@A@@@A@@@@@B@@A@@A@@@A@@A@@@@@@@@A@@@@@@@@@A@@@@@@B"
|
330
|
+
},
|
331
|
+
"warnings": [ ],
|
332
|
+
"waypoint_order": [ ],
|
333
|
+
"bounds": {
|
334
|
+
"southwest": {
|
335
|
+
"lat": 45.3026900,
|
336
|
+
"lng": -75.6984600
|
337
|
+
},
|
338
|
+
"northeast": {
|
339
|
+
"lat": 45.5655200,
|
340
|
+
"lng": -73.5536800
|
341
|
+
}
|
342
|
+
}
|
343
|
+
} ]
|
344
|
+
}
|