Documentation

WithLatLngTrait

Trait for elements with latitude and longitude

Table of Contents

Properties

$EARTHRADIUS  : int
$latitude  : float
$longitude  : float

Methods

distance()  : float
calculate distance from other WithLatLngTrait object
getLatitude()  : float
gets latitude
getLongitude()  : float
gets longitude
nearBy()  : ModelWithLocationCollection|BaseCollection
get elements nearby within radius (in meters)
setLatitude()  : self
sets latitude
setLongitude()  : self
sets longitude

Properties

Methods

distance()

calculate distance from other WithLatLngTrait object

public distance(self $other) : float
Parameters
$other : self
Return values
float

setLatitude()

sets latitude

public setLatitude(float $latitude) : self
Parameters
$latitude : float
Return values
self

setLongitude()

sets longitude

public setLongitude(float $longitude) : self
Parameters
$longitude : float
Return values
self

        
On this page

Search results