PHP Класс Location\Coordinate

Автор: Marcus Jaschen ([email protected])
Наследование: implements location\GeometryInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$ellipsoid Ellipsoid
$lat float
$lng float

Открытые методы

Метод Описание
__construct ( float $lat, float $lng, Ellipsoid $ellipsoid = null )
format ( Location\Formatter\Coordinate\FormatterInterface $formatter ) : mixed
getDistance ( Coordinate $coordinate, Location\Distance\DistanceInterface $calculator ) : float Calculates the distance between the given coordinate and this coordinate.
getEllipsoid ( ) : Ellipsoid
getLat ( ) : float
getLng ( ) : float
getPoints ( ) : array Returns an array containing the point

Защищенные методы

Метод Описание
isNumericInBounds ( float $value, float $lower, float $upper ) : boolean Checks if the given value is (1) numeric, and (2) between lower and upper bounds (including the bounds values).
isValidLatitude ( mixed $latitude ) : boolean Validates latitude
isValidLongitude ( mixed $longitude ) : boolean Validates longitude

Описание методов

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

public __construct ( float $lat, float $lng, Ellipsoid $ellipsoid = null )
$lat float -90.0 .. +90.0
$lng float -180.0 .. +180.0
$ellipsoid Ellipsoid if omitted, WGS-84 is used

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

public format ( Location\Formatter\Coordinate\FormatterInterface $formatter ) : mixed
$formatter Location\Formatter\Coordinate\FormatterInterface
Результат mixed

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

Calculates the distance between the given coordinate and this coordinate.
public getDistance ( Coordinate $coordinate, Location\Distance\DistanceInterface $calculator ) : float
$coordinate Coordinate
$calculator Location\Distance\DistanceInterface instance of distance calculation class
Результат float

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

public getEllipsoid ( ) : Ellipsoid
Результат Ellipsoid

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

public getLat ( ) : float
Результат float

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

public getLng ( ) : float
Результат float

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

Returns an array containing the point
public getPoints ( ) : array
Результат array

isNumericInBounds() защищенный Метод

Checks if the given value is (1) numeric, and (2) between lower and upper bounds (including the bounds values).
protected isNumericInBounds ( float $value, float $lower, float $upper ) : boolean
$value float
$lower float
$upper float
Результат boolean

isValidLatitude() защищенный Метод

Validates latitude
protected isValidLatitude ( mixed $latitude ) : boolean
$latitude mixed
Результат boolean

isValidLongitude() защищенный Метод

Validates longitude
protected isValidLongitude ( mixed $longitude ) : boolean
$longitude mixed
Результат boolean

Описание свойств

$ellipsoid защищенное свойство

protected Ellipsoid,location $ellipsoid
Результат Ellipsoid

$lat защищенное свойство

protected float $lat
Результат float

$lng защищенное свойство

protected float $lng
Результат float