PlacesController

A PlacesController uses the Google Maps API to get place predictions and details.

OptionTypeDefaultValueDescription
apiKeystringYour Google Places API Key.
PropertyTypeDescription
predictionsobject[]The results of a getPlacePredictions call.
detailsobjectThe results of a getPlaceDetails call.
hasPredictionsbooleanWhether the controller has predictions.
autocompleteServiceobjectThe controller's Google AutoCompleteService instance.
geocoderobjectThe controller's Google Geocoder instance.
MethodDescription
getPlacePredictions(string)Fetch place predictions using a string, such as an address or city name.
getPlaceDetails(placeId, options)Fetch place details using a (such as a prediction's place_id), with additional options.

Example: