You are here

public function GeocoderController::geocoderAutocomplete in Geocoder autocomplete 8

Callback Method for Route geocoder_autocomplete.autocomplete.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The Request sent.

Return value

mixed|string Json output of the found strings.

1 string reference to 'GeocoderController::geocoderAutocomplete'
geocoder_autocomplete.routing.yml in ./geocoder_autocomplete.routing.yml
geocoder_autocomplete.routing.yml

File

src/Controller/GeocoderController.php, line 51

Class

GeocoderController
Default controller for the geocoder_autocomplete module.

Namespace

Drupal\geocoder_autocomplete\Controller

Code

public function geocoderAutocomplete(Request $request) {
  $matches = $this->geocoderService
    ->getAddress($request->query
    ->get('q'));
  return new JsonResponse($matches);
}