Tiger_Location_Adapter_Interface
@api
Tiger_Location_Adapter_Interface — the capability contract every Location provider implements.
An adapter declares which of the four operations it can do via capabilities(); the Tiger_Location facade only calls an operation on an adapter that supports it (else it throws Tiger_Location_Exception). Every operation returns Tiger_Location_Place(s), so the payload is identical regardless of provider (AWS Location Service, Nominatim/OSM, Google, Mapbox, an IP-geolocation vendor, …). Extend Tiger_Location_Adapter_Abstract rather than implementing this directly — it defaults every op to "unsupported" so you override only what you actually provide.
Methods
capabilities()
capabilities(): array
The CAP_* operations this adapter supports.
Returns array — the CAP_* operations this adapter supports
suggest()
suggest(string $query, array $opts = []): array
Autocomplete a partial address. Returns Tiger_Location_Place[] — usually id + label (call geocode()/retrieve on a selection for the full structure, or the provider may already include it).
$querystring— the partial address text$optsarray— provider options
Returns array
geocode()
geocode(string $query, array $opts = []): array
Geocode free text to structured address(es) with coordinates.
$querystring— the address text to geocode$optsarray— provider options
Returns array
reverse()
reverse(float $lat, float $lng, array $opts = []): ?Tiger_Location_Place
Reverse-geocode coordinates to the nearest address.
$latfloat— the latitude$lngfloat— the longitude$optsarray— provider options
Returns ?Tiger_Location_Place — the nearest place, or null when unplaceable
ip()
ip(string $ip, array $opts = []): ?Tiger_Location_Place
Approximate location for an IP address.
$ipstring— the IP address to look up$optsarray— provider options
Returns ?Tiger_Location_Place — the place, or null when unplaceable