Geocoder\Geocoder::limit PHP Метод

limit() публичный Метод

Sets the maximum number of Address objects that can be returned by geocode() or reverse() methods.
public limit ( integer $limit ) : Geocoder
$limit integer
Результат Geocoder
    public function limit($limit);

Usage Example

Пример #1
0
 public function compare(\Geocoder\Geocoder $geocoder)
 {
     $data = new \stdClass();
     try {
         $time_pre = microtime(true);
         $address = $geocoder->limit(1)->geocode($this->query)->first();
         $time_post = microtime(true);
         $formatter = new \Geocoder\Formatter\StringFormatter();
         $data->address = $formatter->format($address, "%S %n, %z %L");
         $data->latitude = $address->getLatitude();
         $data->longitude = $address->getLongitude();
         $data->microtime = $time_post - $time_pre;
     } catch (\Exception $e) {
         $data = $e->getMessage();
     }
     $this->table[$geocoder->getName()] = $data;
     return $this;
 }
All Usage Examples Of Geocoder\Geocoder::limit