GoogleMapsGeocoder
in package
A PHP wrapper for the Google Maps Geocoding API v3.
Tags
Table of Contents
- EQUATOR_LAT_DEGREE_IN_MILES = 69.172
- Helps calculate a more realistic bounding box by taking into account the curvature of the earth's surface.
- FORMAT_JSON = "json"
- JSON response format.
- FORMAT_XML = "xml"
- XML response format.
- LOCATION_TYPE_APPROXIMATE = "APPROXIMATE"
- Returned result is approximate.
- LOCATION_TYPE_CENTER = "GEOMETRIC_CENTER"
- Returned result is the geometric center of a polyline (i.e., a street) or polygon (i.e., a region).
- LOCATION_TYPE_RANGE = "RANGE_INTERPOLATED"
- Returned result is between two precise points (usually on a road).
- LOCATION_TYPE_ROOFTOP = "ROOFTOP"
- Returned result is a precise street address.
- STATUS_INVALID_REQUEST = "INVALID_REQUEST"
- Invalid request, usually because of missing parameter that's required.
- STATUS_NO_RESULTS = "ZERO_RESULTS"
- Geocode was successful, but returned no results.
- STATUS_OVER_LIMIT = "OVER_QUERY_LIMIT"
- Over limit of 2,500 (100,000 if premier) requests per day.
- STATUS_REQUEST_DENIED = "REQUEST_DENIED"
- Request denied, usually because of missing sensor parameter.
- STATUS_SUCCESS = "OK"
- No errors occurred, the address was successfully parsed and at least one geocode was returned.
- STATUS_UNKNOWN_ERROR = "UNKNOWN_ERROR"
- Unnown server error. May succeed if tried again.
- TYPE_ADMIN_AREA_1 = "administrative_area_level_1"
- A first-order civil entity below country (states within the US).
- TYPE_ADMIN_AREA_2 = "administrative_area_level_2"
- A second-order civil entity below country (counties within the US).
- TYPE_ADMIN_AREA_3 = "administrative_area_level_3"
- A third-order civil entity below country.
- TYPE_ADMIN_AREA_4 = "administrative_area_level_4"
- A fourth-order civil entity below country.
- TYPE_ADMIN_AREA_5 = "administrative_area_level_5"
- A fifth-order civil entity below country.
- TYPE_AIRPORT = "airport"
- An airport.
- TYPE_BUS_STATION = "bus_station"
- A bus stop.
- TYPE_COLLOQUIAL_AREA = "colloquial_area"
- A commonly-used alternative name for the entity.
- TYPE_COUNTRY = "country"
- A national political entity (country). The highest order type returned.
- TYPE_ESTABLISHMENT = "establishment"
- A place that has not yet been categorized.
- TYPE_FLOOR = "floor"
- A floor of a building address.
- TYPE_INTERSECTION = "intersection"
- A major intersection, usually of two major roads.
- TYPE_LOCALITY = "locality"
- An incorporated city or town.
- TYPE_NATURAL_FEATURE = "natural_feature"
- A prominent natural feature.
- TYPE_NEIGHBORHOOD = "neighborhood"
- A named neighborhood.
- TYPE_PARK = "park"
- A named park.
- TYPE_PARKING = "parking"
- A parking lot or parking structure.
- TYPE_POINT_OF_INTEREST = "point_of_interest"
- A named point of interest that doesn't fit within another category.
- TYPE_POLITICAL = "political"
- A political entity, usually of some civil administration.
- TYPE_POST_BOX = "post_box"
- A specific postal box.
- TYPE_POSTAL_CODE = "postal_code"
- A postal code as used to address mail within the country.
- TYPE_POSTAL_TOWN = "postal_town"
- A grouping of geographic areas used for mailing addresses in some countries.
- TYPE_PREMISE = "premise"
- A named location, usually a building or collection of buildings.
- TYPE_ROOM = "room"
- A room of a building address.
- TYPE_ROUTE = "route"
- A named route (such as "US 101").
- TYPE_STREET_ADDRESS = "street_address"
- A precise street address.
- TYPE_STREET_NUMBER = "street_number"
- A precise street number.
- TYPE_SUB_LOCALITY = "sublocality"
- A first-order civil entity below a locality.
- TYPE_SUB_PREMISE = "subpremise"
- A first-order entity below a named location, usually a single building within a collection of building with a common name.
- TYPE_TRAIN_STATION = "train_station"
- A train stop.
- TYPE_TRANSIT_STATION = "transit_station"
- A public transit stop.
- TYPE_WARD = "ward"
- A specific type of Japanese locality.
- URL_DOMAIN = "maps.googleapis.com"
- Domain portion of the Google Geocoding API URL.
- URL_HTTP = "http://maps.googleapis.com/maps/api/geocode/"
- HTTP URL of the Google Geocoding API.
- URL_HTTPS = "https://maps.googleapis.com/maps/api/geocode/"
- HTTPS URL of the Google Geocoding API.
- URL_PATH = "/maps/api/geocode/"
- Path portion of the Google Geocoding API URL.
- __construct() : GoogleMapsGeocoder
- Constructor. The request is not executed until `geocode()` is called.
- boundingBox() : array<string|int, mixed>
- Computes a four point bounding box around the specified location. This can then be used to find all locations within an X-mile range of a central location. A bounding box is much easier and faster to compute than a bounding radius.
- geocode() : string|array<string|int, mixed>|SimpleXMLElement
- Execute the geocoding request. The return type is based on the requested format: associative array if JSON, SimpleXMLElement object if XML.
- getAddress() : string
- Get the address to geocode.
- getApiKey() : string
- Get the API key to authenticate with.
- getBounds() : string|false
- Get the bounding box coordinates within which to bias geocode results in comma-separated, pipe-delimited format.
- getBoundsNortheast() : string|false
- Get the northeast coordinates of the bounding box within which to bias geocode results in comma-separated format.
- getBoundsNortheastLatitude() : float|string
- Get the northeast latitude of the bounding box within which to bias geocode results.
- getBoundsNortheastLongitude() : float|string
- Get the northeast longitude of the bounding box within which to bias geocode results.
- getBoundsSouthwest() : string|false
- Get the southwest coordinates of the bounding box within which to bias geocode results in comma-separated format.
- getBoundsSouthwestLatitude() : float|string
- Get the southwest latitude of the bounding box within which to bias geocode results.
- getBoundsSouthwestLongitude() : float|string
- Get the southwest longitude of the bounding box within which to bias geocode results.
- getClientId() : string
- Get the client ID for Business clients.
- getFormat() : string
- Get the response format.
- getLanguage() : string
- Get the language code in which to return results.
- getLatitude() : float|string
- Get the latitude to reverse geocode to the closest address.
- getLatitudeLongitude() : string|false
- Get the latitude/longitude to reverse geocode to the closest address in comma-separated format.
- getLocationType() : array<string|int, mixed>
- Get the location type(s) to restrict results to.
- getLocationTypeFormatted() : string
- Get the location type(s) to restrict results to separated by a pipe (|).
- getLongitude() : float|string
- Get the longitude to reverse geocode to the closest address.
- getRegion() : string
- Get the two-character, top-level domain (ccTLD) within which to bias geocode results.
- getResultType() : array<string|int, mixed>
- Get the address type(s) to restrict results to.
- getResultTypeFormatted() : string
- Get the address type(s) to restrict results to separated by a pipe (|).
- getSensor() : string
- Get whether the request is from a device with a location sensor.
- getSigningKey() : string
- Get the cryptographic signing key for Business clients.
- isBusinessClient() : bool
- Whether the request is for a Business client.
- isFormatJson() : bool
- Whether the response format is JSON.
- isFormatXml() : bool
- Whether the response format is XML.
- setAddress() : GoogleMapsGeocoder
- Set the address to geocode.
- setApiKey() : GoogleMapsGeocoder
- Set the API key to authenticate with.
- setBounds() : GoogleMapsGeocoder
- Set the bounding box coordinates within which to bias geocode results.
- setBoundsNortheast() : GoogleMapsGeocoder
- Set the northeast coordinates of the bounding box within which to bias geocode results.
- setBoundsSouthwest() : GoogleMapsGeocoder
- Set the southwest coordinates of the bounding box within which to bias geocode results.
- setClientId() : GoogleMapsGeocoder
- Set the client ID for Business clients.
- setFormat() : GoogleMapsGeocoder
- Set the response format.
- setLanguage() : GoogleMapsGeocoder
- Set the language code in which to return results.
- setLatitude() : GoogleMapsGeocoder
- Set the latitude to reverse geocode to the closest address.
- setLatitudeLongitude() : GoogleMapsGeocoder
- Set the latitude/longitude to reverse geocode to the closest address.
- setLocationType() : GoogleMapsGeocoder
- Set the location type(s) to restrict results to.
- setLongitude() : GoogleMapsGeocoder
- Set the longitude to reverse geocode to the closest address.
- setRegion() : GoogleMapsGeocoder
- Set the two-character, top-level domain (ccTLD) within which to bias geocode results.
- setResultType() : GoogleMapsGeocoder
- Set the address type(s) to restrict results to.
- setSensor() : GoogleMapsGeocoder
- Set whether the request is from a device with a location sensor.
- setSigningKey() : GoogleMapsGeocoder
- Set the cryptographic signing key for Business clients.
Constants
EQUATOR_LAT_DEGREE_IN_MILES
Helps calculate a more realistic bounding box by taking into account the curvature of the earth's surface.
public
mixed
EQUATOR_LAT_DEGREE_IN_MILES
= 69.172
Tags
FORMAT_JSON
JSON response format.
public
mixed
FORMAT_JSON
= "json"
Tags
FORMAT_XML
XML response format.
public
mixed
FORMAT_XML
= "xml"
Tags
LOCATION_TYPE_APPROXIMATE
Returned result is approximate.
public
mixed
LOCATION_TYPE_APPROXIMATE
= "APPROXIMATE"
Tags
LOCATION_TYPE_CENTER
Returned result is the geometric center of a polyline (i.e., a street) or polygon (i.e., a region).
public
mixed
LOCATION_TYPE_CENTER
= "GEOMETRIC_CENTER"
Tags
LOCATION_TYPE_RANGE
Returned result is between two precise points (usually on a road).
public
mixed
LOCATION_TYPE_RANGE
= "RANGE_INTERPOLATED"
Tags
LOCATION_TYPE_ROOFTOP
Returned result is a precise street address.
public
mixed
LOCATION_TYPE_ROOFTOP
= "ROOFTOP"
Tags
STATUS_INVALID_REQUEST
Invalid request, usually because of missing parameter that's required.
public
mixed
STATUS_INVALID_REQUEST
= "INVALID_REQUEST"
Tags
STATUS_NO_RESULTS
Geocode was successful, but returned no results.
public
mixed
STATUS_NO_RESULTS
= "ZERO_RESULTS"
Tags
STATUS_OVER_LIMIT
Over limit of 2,500 (100,000 if premier) requests per day.
public
mixed
STATUS_OVER_LIMIT
= "OVER_QUERY_LIMIT"
Tags
STATUS_REQUEST_DENIED
Request denied, usually because of missing sensor parameter.
public
mixed
STATUS_REQUEST_DENIED
= "REQUEST_DENIED"
Tags
STATUS_SUCCESS
No errors occurred, the address was successfully parsed and at least one geocode was returned.
public
mixed
STATUS_SUCCESS
= "OK"
Tags
STATUS_UNKNOWN_ERROR
Unnown server error. May succeed if tried again.
public
mixed
STATUS_UNKNOWN_ERROR
= "UNKNOWN_ERROR"
Tags
TYPE_ADMIN_AREA_1
A first-order civil entity below country (states within the US).
public
mixed
TYPE_ADMIN_AREA_1
= "administrative_area_level_1"
Tags
TYPE_ADMIN_AREA_2
A second-order civil entity below country (counties within the US).
public
mixed
TYPE_ADMIN_AREA_2
= "administrative_area_level_2"
Tags
TYPE_ADMIN_AREA_3
A third-order civil entity below country.
public
mixed
TYPE_ADMIN_AREA_3
= "administrative_area_level_3"
Tags
TYPE_ADMIN_AREA_4
A fourth-order civil entity below country.
public
mixed
TYPE_ADMIN_AREA_4
= "administrative_area_level_4"
Tags
TYPE_ADMIN_AREA_5
A fifth-order civil entity below country.
public
mixed
TYPE_ADMIN_AREA_5
= "administrative_area_level_5"
Tags
TYPE_AIRPORT
An airport.
public
mixed
TYPE_AIRPORT
= "airport"
Tags
TYPE_BUS_STATION
A bus stop.
public
mixed
TYPE_BUS_STATION
= "bus_station"
Tags
TYPE_COLLOQUIAL_AREA
A commonly-used alternative name for the entity.
public
mixed
TYPE_COLLOQUIAL_AREA
= "colloquial_area"
Tags
TYPE_COUNTRY
A national political entity (country). The highest order type returned.
public
mixed
TYPE_COUNTRY
= "country"
Tags
TYPE_ESTABLISHMENT
A place that has not yet been categorized.
public
mixed
TYPE_ESTABLISHMENT
= "establishment"
Tags
TYPE_FLOOR
A floor of a building address.
public
mixed
TYPE_FLOOR
= "floor"
Tags
TYPE_INTERSECTION
A major intersection, usually of two major roads.
public
mixed
TYPE_INTERSECTION
= "intersection"
Tags
TYPE_LOCALITY
An incorporated city or town.
public
mixed
TYPE_LOCALITY
= "locality"
Tags
TYPE_NATURAL_FEATURE
A prominent natural feature.
public
mixed
TYPE_NATURAL_FEATURE
= "natural_feature"
Tags
TYPE_NEIGHBORHOOD
A named neighborhood.
public
mixed
TYPE_NEIGHBORHOOD
= "neighborhood"
Tags
TYPE_PARK
A named park.
public
mixed
TYPE_PARK
= "park"
Tags
TYPE_PARKING
A parking lot or parking structure.
public
mixed
TYPE_PARKING
= "parking"
Tags
TYPE_POINT_OF_INTEREST
A named point of interest that doesn't fit within another category.
public
mixed
TYPE_POINT_OF_INTEREST
= "point_of_interest"
Tags
TYPE_POLITICAL
A political entity, usually of some civil administration.
public
mixed
TYPE_POLITICAL
= "political"
Tags
TYPE_POST_BOX
A specific postal box.
public
mixed
TYPE_POST_BOX
= "post_box"
Tags
TYPE_POSTAL_CODE
A postal code as used to address mail within the country.
public
mixed
TYPE_POSTAL_CODE
= "postal_code"
Tags
TYPE_POSTAL_TOWN
A grouping of geographic areas used for mailing addresses in some countries.
public
mixed
TYPE_POSTAL_TOWN
= "postal_town"
Tags
TYPE_PREMISE
A named location, usually a building or collection of buildings.
public
mixed
TYPE_PREMISE
= "premise"
Tags
TYPE_ROOM
A room of a building address.
public
mixed
TYPE_ROOM
= "room"
Tags
TYPE_ROUTE
A named route (such as "US 101").
public
mixed
TYPE_ROUTE
= "route"
Tags
TYPE_STREET_ADDRESS
A precise street address.
public
mixed
TYPE_STREET_ADDRESS
= "street_address"
Tags
TYPE_STREET_NUMBER
A precise street number.
public
mixed
TYPE_STREET_NUMBER
= "street_number"
Tags
TYPE_SUB_LOCALITY
A first-order civil entity below a locality.
public
mixed
TYPE_SUB_LOCALITY
= "sublocality"
Tags
TYPE_SUB_PREMISE
A first-order entity below a named location, usually a single building within a collection of building with a common name.
public
mixed
TYPE_SUB_PREMISE
= "subpremise"
Tags
TYPE_TRAIN_STATION
A train stop.
public
mixed
TYPE_TRAIN_STATION
= "train_station"
Tags
TYPE_TRANSIT_STATION
A public transit stop.
public
mixed
TYPE_TRANSIT_STATION
= "transit_station"
Tags
TYPE_WARD
A specific type of Japanese locality.
public
mixed
TYPE_WARD
= "ward"
Tags
URL_DOMAIN
Domain portion of the Google Geocoding API URL.
public
mixed
URL_DOMAIN
= "maps.googleapis.com"
Tags
URL_HTTP
HTTP URL of the Google Geocoding API.
public
mixed
URL_HTTP
= "http://maps.googleapis.com/maps/api/geocode/"
Tags
URL_HTTPS
HTTPS URL of the Google Geocoding API.
public
mixed
URL_HTTPS
= "https://maps.googleapis.com/maps/api/geocode/"
Tags
URL_PATH
Path portion of the Google Geocoding API URL.
public
mixed
URL_PATH
= "/maps/api/geocode/"
Tags
Methods
__construct()
Constructor. The request is not executed until `geocode()` is called.
public
__construct([string $address = null ][, string $format = self::FORMAT_JSON ][, bool|string $sensor = false ]) : GoogleMapsGeocoder
Parameters
- $address : string = null
-
optional address to geocode
- $format : string = self::FORMAT_JSON
-
optional response format (JSON default)
- $sensor : bool|string = false
-
deprecated as of v2.3.0
Tags
Return values
GoogleMapsGeocoder —boundingBox()
Computes a four point bounding box around the specified location. This can then be used to find all locations within an X-mile range of a central location. A bounding box is much easier and faster to compute than a bounding radius.
public
static boundingBox(float|string $latitude, float|string $longitude, int|float|string $mileRange) : array<string|int, mixed>
The returned array contains two keys: 'lat' and 'lon'. Each of these contains another array with two keys: 'max' and 'min'. Four points are returned in total.
Parameters
- $latitude : float|string
-
to draw the bounding box around
- $longitude : float|string
-
to draw the bounding box around
- $mileRange : int|float|string
-
mile range around point
Tags
Return values
array<string|int, mixed> —'lat' and 'lon' 'min' and 'max' points
geocode()
Execute the geocoding request. The return type is based on the requested format: associative array if JSON, SimpleXMLElement object if XML.
public
geocode([bool $https = false ][, bool $raw = false ][, resource $context = null ]) : string|array<string|int, mixed>|SimpleXMLElement
Parameters
- $https : bool = false
-
whether to make the request over HTTPS
- $raw : bool = false
-
whether to return the raw (string) response
- $context : resource = null
-
stream context from
stream_context_create()
Tags
Return values
string|array<string|int, mixed>|SimpleXMLElement —response in requested format
getAddress()
Get the address to geocode.
public
getAddress() : string
Tags
Return values
string —getApiKey()
Get the API key to authenticate with.
public
getApiKey() : string
Tags
Return values
string —API key
getBounds()
Get the bounding box coordinates within which to bias geocode results in comma-separated, pipe-delimited format.
public
getBounds() : string|false
Tags
Return values
string|false —comma-separated, pipe-delimited coordinates, or false if not set
getBoundsNortheast()
Get the northeast coordinates of the bounding box within which to bias geocode results in comma-separated format.
public
getBoundsNortheast() : string|false
Tags
Return values
string|false —comma-separated coordinates, or false if not set
getBoundsNortheastLatitude()
Get the northeast latitude of the bounding box within which to bias geocode results.
public
getBoundsNortheastLatitude() : float|string
Tags
Return values
float|string —northeast latitude boundary
getBoundsNortheastLongitude()
Get the northeast longitude of the bounding box within which to bias geocode results.
public
getBoundsNortheastLongitude() : float|string
Tags
Return values
float|string —northeast longitude boundary
getBoundsSouthwest()
Get the southwest coordinates of the bounding box within which to bias geocode results in comma-separated format.
public
getBoundsSouthwest() : string|false
Tags
Return values
string|false —comma-separated coordinates, or false if not set
getBoundsSouthwestLatitude()
Get the southwest latitude of the bounding box within which to bias geocode results.
public
getBoundsSouthwestLatitude() : float|string
Tags
Return values
float|string —southwest latitude boundary
getBoundsSouthwestLongitude()
Get the southwest longitude of the bounding box within which to bias geocode results.
public
getBoundsSouthwestLongitude() : float|string
Tags
Return values
float|string —southwest longitude boundary
getClientId()
Get the client ID for Business clients.
public
getClientId() : string
Tags
Return values
string —client ID
getFormat()
Get the response format.
public
getFormat() : string
Tags
Return values
string —response format
getLanguage()
Get the language code in which to return results.
public
getLanguage() : string
Tags
Return values
string —language code
getLatitude()
Get the latitude to reverse geocode to the closest address.
public
getLatitude() : float|string
Tags
Return values
float|string —latitude to reverse geocode
getLatitudeLongitude()
Get the latitude/longitude to reverse geocode to the closest address in comma-separated format.
public
getLatitudeLongitude() : string|false
Tags
Return values
string|false —comma-separated coordinates, or false if not set
getLocationType()
Get the location type(s) to restrict results to.
public
getLocationType() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —location type(s)
getLocationTypeFormatted()
Get the location type(s) to restrict results to separated by a pipe (|).
public
getLocationTypeFormatted() : string
Tags
Return values
string —location type(s) separated by a pipe (|)
getLongitude()
Get the longitude to reverse geocode to the closest address.
public
getLongitude() : float|string
Tags
Return values
float|string —longitude to reverse geocode
getRegion()
Get the two-character, top-level domain (ccTLD) within which to bias geocode results.
public
getRegion() : string
Tags
Return values
string —two-character, top-level domain (ccTLD)
getResultType()
Get the address type(s) to restrict results to.
public
getResultType() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —address type(s)
getResultTypeFormatted()
Get the address type(s) to restrict results to separated by a pipe (|).
public
getResultTypeFormatted() : string
Tags
Return values
string —address type(s) separated by a pipe (|)
getSensor()
Get whether the request is from a device with a location sensor.
public
getSensor() : string
Tags
Return values
string —'true' or 'false'
getSigningKey()
Get the cryptographic signing key for Business clients.
public
getSigningKey() : string
Tags
Return values
string —cryptographic signing key
isBusinessClient()
Whether the request is for a Business client.
public
isBusinessClient() : bool
Tags
Return values
bool —whether the request is for a Business client
isFormatJson()
Whether the response format is JSON.
public
isFormatJson() : bool
Tags
Return values
bool —whether JSON
isFormatXml()
Whether the response format is XML.
public
isFormatXml() : bool
Tags
Return values
bool —whether XML
setAddress()
Set the address to geocode.
public
setAddress(string $address) : GoogleMapsGeocoder
Parameters
- $address : string
-
address to geocode
Tags
Return values
GoogleMapsGeocoder —setApiKey()
Set the API key to authenticate with.
public
setApiKey(string $apiKey) : GoogleMapsGeocoder
Parameters
- $apiKey : string
-
API key
Tags
Return values
GoogleMapsGeocoder —setBounds()
Set the bounding box coordinates within which to bias geocode results.
public
setBounds(float|string $southwestLatitude, float|string $southwestLongitude, float|string $northeastLatitude, float|string $northeastLongitude) : GoogleMapsGeocoder
Parameters
- $southwestLatitude : float|string
-
southwest latitude boundary
- $southwestLongitude : float|string
-
southwest longitude boundary
- $northeastLatitude : float|string
-
northeast latitude boundary
- $northeastLongitude : float|string
-
northeast longitude boundary
Tags
Return values
GoogleMapsGeocoder —setBoundsNortheast()
Set the northeast coordinates of the bounding box within which to bias geocode results.
public
setBoundsNortheast(float|string $latitude, float|string $longitude) : GoogleMapsGeocoder
Parameters
- $latitude : float|string
-
northeast latitude boundary
- $longitude : float|string
-
northeast longitude boundary
Tags
Return values
GoogleMapsGeocoder —setBoundsSouthwest()
Set the southwest coordinates of the bounding box within which to bias geocode results.
public
setBoundsSouthwest(float|string $latitude, float|string $longitude) : GoogleMapsGeocoder
Parameters
- $latitude : float|string
-
southwest latitude boundary
- $longitude : float|string
-
southwest longitude boundary
Tags
Return values
GoogleMapsGeocoder —setClientId()
Set the client ID for Business clients.
public
setClientId(string $clientId) : GoogleMapsGeocoder
Parameters
- $clientId : string
-
client ID
Tags
Return values
GoogleMapsGeocoder —setFormat()
Set the response format.
public
setFormat(string $format) : GoogleMapsGeocoder
Parameters
- $format : string
-
response format
Tags
Return values
GoogleMapsGeocoder —setLanguage()
Set the language code in which to return results.
public
setLanguage(string $language) : GoogleMapsGeocoder
Parameters
- $language : string
-
language code
Tags
Return values
GoogleMapsGeocoder —setLatitude()
Set the latitude to reverse geocode to the closest address.
public
setLatitude(float|string $latitude) : GoogleMapsGeocoder
Parameters
- $latitude : float|string
-
latitude to reverse geocode
Tags
Return values
GoogleMapsGeocoder —setLatitudeLongitude()
Set the latitude/longitude to reverse geocode to the closest address.
public
setLatitudeLongitude(float|string $latitude, float|string $longitude) : GoogleMapsGeocoder
Parameters
- $latitude : float|string
-
latitude to reverse geocode
- $longitude : float|string
-
longitude to reverse geocode
Tags
Return values
GoogleMapsGeocoder —setLocationType()
Set the location type(s) to restrict results to.
public
setLocationType(string|array<string|int, mixed> $locationType) : GoogleMapsGeocoder
Parameters
- $locationType : string|array<string|int, mixed>
-
location type(s)
Tags
Return values
GoogleMapsGeocoder —setLongitude()
Set the longitude to reverse geocode to the closest address.
public
setLongitude(float|string $longitude) : GoogleMapsGeocoder
Parameters
- $longitude : float|string
-
longitude to reverse geocode
Tags
Return values
GoogleMapsGeocoder —setRegion()
Set the two-character, top-level domain (ccTLD) within which to bias geocode results.
public
setRegion(string $region) : GoogleMapsGeocoder
Parameters
- $region : string
-
two-character, top-level domain (ccTLD)
Tags
Return values
GoogleMapsGeocoder —setResultType()
Set the address type(s) to restrict results to.
public
setResultType(string|array<string|int, mixed> $resultType) : GoogleMapsGeocoder
Parameters
- $resultType : string|array<string|int, mixed>
-
address type(s)
Tags
Return values
GoogleMapsGeocoder —setSensor()
Set whether the request is from a device with a location sensor.
public
setSensor(bool|string $sensor) : GoogleMapsGeocoder
Parameters
- $sensor : bool|string
-
boolean or 'true'/'false' string
Tags
Return values
GoogleMapsGeocoder —setSigningKey()
Set the cryptographic signing key for Business clients.
public
setSigningKey(string $signingKey) : GoogleMapsGeocoder
Parameters
- $signingKey : string
-
cryptographic signing key