File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -60,4 +60,14 @@ public function getPoint()
6060 {
6161 return new Point ($ this ->lat , $ this ->long );
6262 }
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+ }
6373}
Original file line number Diff line number Diff line change @@ -170,14 +170,6 @@ public function reverseGeocode(LatLong $latLong)
170170 */
171171 public function directions ($ from , $ to , $ travelMode = TravelMode::DRIVING )
172172 {
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-
181173 $ queryUrl = $ this ->authObject ->applyToUrl (
182174 $ this ->baseUrl .'directions/json?origin= ' .urlencode ($ from ).
183175 '&destination= ' .urlencode ($ to ).'&mode= ' .$ travelMode
You can’t perform that action at this time.
0 commit comments