@@ 126-141 (lines=16) @@ | ||
123 | } |
|
124 | } |
|
125 | ||
126 | public function getRoutePoints($routeId, $params) |
|
127 | { |
|
128 | $result = Route4Me::makeRequst(array( |
|
129 | 'url' => Endpoint::ROUTE_V4, |
|
130 | 'method' => 'GET', |
|
131 | 'query' => array( |
|
132 | 'api_key' => Route4Me::getApiKey(), |
|
133 | 'route_id' => $routeId, |
|
134 | 'route_path_output' => isset($params['route_path_output']) ? $params['route_path_output'] : null, |
|
135 | 'compress_path_points' => isset($params['compress_path_points']) ? $params['compress_path_points'] : null, |
|
136 | 'directions' => isset($params['directions']) ? $params['directions'] : null, |
|
137 | ) |
|
138 | )); |
|
139 | ||
140 | return $result; |
|
141 | } |
|
142 | ||
143 | public function duplicateRoute($route_id) |
|
144 | { |
|
@@ 158-174 (lines=17) @@ | ||
155 | return $result; |
|
156 | } |
|
157 | ||
158 | public function resequenceRoute($params) |
|
159 | { |
|
160 | $result = Route4Me::makeRequst(array( |
|
161 | 'url' => Endpoint::ROUTE_V4, |
|
162 | 'method' => 'PUT', |
|
163 | 'query' => array( |
|
164 | 'api_key' => Route4Me::getApiKey(), |
|
165 | 'route_id' => isset($params['route_id']) ? $params['route_id'] : null, |
|
166 | 'route_destination_id' => isset($params['route_destination_id']) ? $params['route_destination_id'] : null, |
|
167 | ), |
|
168 | 'body' => array( |
|
169 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
170 | ) |
|
171 | )); |
|
172 | ||
173 | return $result; |
|
174 | } |
|
175 | ||
176 | public function resequenceAllAddresses($params) |
|
177 | { |
|
@@ 213-230 (lines=18) @@ | ||
210 | return $result; |
|
211 | } |
|
212 | ||
213 | public function shareRoute($params) |
|
214 | { |
|
215 | $result = Route4Me::makeRequst(array( |
|
216 | 'url' => Endpoint::ROUTE_SHARE, |
|
217 | 'method' => 'POST', |
|
218 | 'query' => array( |
|
219 | 'api_key' => Route4Me::getApiKey(), |
|
220 | 'route_id' => isset($params['route_id']) ? $params['route_id'] : null, |
|
221 | 'response_format' => isset($params['response_format']) ? $params['response_format'] : null, |
|
222 | ), |
|
223 | 'body' => array( |
|
224 | 'recipient_email' => isset($params['recipient_email']) ? $params['recipient_email'] : null, |
|
225 | ), |
|
226 | 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
227 | )); |
|
228 | ||
229 | return $result; |
|
230 | } |
|
231 | ||
232 | // Returns random route_id from existing routes between $offset and $offset+$limit |
|
233 | public function getRandomRouteId($offset,$limit) |
|
@@ 338-354 (lines=17) @@ | ||
335 | return Route::fromArray($route); |
|
336 | } |
|
337 | ||
338 | public function insertAddressOptimalPosition(array $params) |
|
339 | { |
|
340 | $route = Route4Me::makeRequst(array( |
|
341 | 'url' => Endpoint::ROUTE_V4, |
|
342 | 'method' => 'PUT', |
|
343 | 'query' => array( |
|
344 | 'api_key' => Route4Me::getApiKey(), |
|
345 | 'route_id' => isset($params['route_id']) ? $params['route_id'] : null, |
|
346 | ), |
|
347 | 'body' => array( |
|
348 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
349 | 'optimal_position' => isset($params['optimal_position']) ? $params['optimal_position'] : null, |
|
350 | ) |
|
351 | )); |
|
352 | ||
353 | return Route::fromArray($route); |
|
354 | } |
|
355 | ||
356 | public function addNoteFile($params) |
|
357 | { |