PHP 클래스 Google\Cloud\Datastore\GeoPoint

Example: $point = new GeoPoint(37.423147, -122.085015);
또한 보기: https://cloud.google.com/datastore/reference/rest/Shared.Types/LatLng LatLng
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( float | integer $latitude, float | integer $longitude ) Create a GeoPoint.
latitude ( ) : float Get the latitude
longitude ( ) : float Get the longitude
point ( ) : array Return a GeoPoint
setLatitude ( integer | float $latitude ) : GeoPoint Set the latitude
setLongitude ( float | integer $longitude ) : GeoPoint Set the longitude

비공개 메소드들

메소드 설명
checkContext ( string $method, array $args ) : void Let people know if they accidentally use the getter in setter context.

메소드 상세

__construct() 공개 메소드

Ints will be converted to floats. Values not passing the is_numeric() check will result in an exception.
public __construct ( float | integer $latitude, float | integer $longitude )
$latitude float | integer
$longitude float | integer

latitude() 공개 메소드

Example: $latitude = $point->latitude();
public latitude ( ) : float
리턴 float

longitude() 공개 메소드

Example: $longitude = $point->longitude();
public longitude ( ) : float
리턴 float

point() 공개 메소드

Example: $point = $point->point();
public point ( ) : array
리턴 array [LatLng](https://cloud.google.com/datastore/reference/rest/Shared.Types/LatLng)

setLatitude() 공개 메소드

Non-numeric values will result in an exception Example: $point->setLatitude(42.279594);
public setLatitude ( integer | float $latitude ) : GeoPoint
$latitude integer | float The new latitude
리턴 GeoPoint

setLongitude() 공개 메소드

Non-numeric values will result in an exception. Example: $point->setLongitude(-83.732124);
public setLongitude ( float | integer $longitude ) : GeoPoint
$longitude float | integer The new longitude value
리턴 GeoPoint