Ejemplo n.º 1
0
 public function testAsync()
 {
     $params = new CarRouteParams();
     $params->addWaypoint('82.838287 54.96579')->addWaypoint([82.83828699999999, 54.97979]);
     $requests = new AsyncParams();
     for ($x = 0; $x < 1; $x++) {
         $requests->addRequest('transport/calculate_directions', $params);
     }
     /** @var  $data GisResponse[] */
     $data = Api2Gis::call()->getAsync($requests->getRequests());
     $this->assertGreaterThan(0, $data[0]->getCount());
     $this->assertGreaterThan(0, count($data[0]->getItems()));
 }
Ejemplo n.º 2
0
 /**
  * Поиск проезда на машине от точки до точки
  * @param CarRouteParams $params
  * @return GisResponse
  * @throws \HttpResponseException
  */
 public function CarRouteDirections(CarRouteParams $params)
 {
     return $this->_callApi('transport/calculate_directions', $params->toArray());
 }