File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -60,4 +60,14 @@ public function getPoint()
60
60
{
61
61
return new Point ($ this ->lat , $ this ->long );
62
62
}
63
+
64
+ /**
65
+ * Convert LatLong to 'latitude,longitude' string format.
66
+ *
67
+ * @return string
68
+ */
69
+ public function __toString ()
70
+ {
71
+ return $ this ->lat .', ' .$ this ->long ;
72
+ }
63
73
}
Original file line number Diff line number Diff line change @@ -170,14 +170,6 @@ public function reverseGeocode(LatLong $latLong)
170
170
*/
171
171
public function directions ($ from , $ to , $ travelMode = TravelMode::DRIVING )
172
172
{
173
- if (is_object ($ from ) && get_class ($ from ) === LatLong::class) {
174
- $ from = $ from ->lat .', ' .$ from ->long ;
175
- }
176
-
177
- if (is_object ($ to ) && get_class ($ to ) === LatLong::class) {
178
- $ to = $ to ->lat .', ' .$ to ->long ;
179
- }
180
-
181
173
$ queryUrl = $ this ->authObject ->applyToUrl (
182
174
$ this ->baseUrl .'directions/json?origin= ' .urlencode ($ from ).
183
175
'&destination= ' .urlencode ($ to ).'&mode= ' .$ travelMode
You can’t perform that action at this time.
0 commit comments