Geocoder
This section will go over how to use the geocoder utility included with the geocoder field type.
To get started use the geocoder field type to create a new geocoder instance:
$geocoder = $fieldType->newGeocoder();
GeocoderFieldTypeGeocoder::convert()
The convert
method will convert the provided address into a geocoded point
object.
Returns: \Anomaly\GeocoderFieldType\GeocoderFieldTypePoint
Arguments
Key | Required | Type | Default | Description |
---|---|---|---|---|
$address | true | string | none | The address to geocode. Partial addresses are supported as well. |
Example
$point = $geocoder->convert('Davenport, IA');
GeocoderFieldTypeGeocoder::reverse()
The reverse
method performs a reverse geocode lookup.
Arguments
Key | Required | Type | Default | Description |
---|---|---|---|---|
$collection | true | string | none | The collection to add the asset to. |