tp TouchPointWP Geo - TenthPres/TouchPoint-WP GitHub Wiki
tp\TouchPointWP\Geo
A standardized set of fields for geographical information.
- Full name:
\tp\TouchPointWP\Geo - Parent class:
stdClass
Properties
lat
public ?float $lat
lng
public ?float $lng
human
public ?string $human
type
public ?string $type
Methods
__construct
public __construct(?float $lat = null, ?float $lng = null, ?string $human = null, ?string $type = null): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$lat |
?float | |
$lng |
?float | |
$human |
?string | |
$type |
?string |
distance
Get distance between two geographic points by lat/lng pairs. Returns a number in miles.
public static distance(float $latA, float $lngA, float $latB, float $lngB): float
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$latA |
float | |
$lngA |
float | |
$latB |
float | |
$lngB |
float |