Geocoder

Geocoder class

google.maps.Geocoder class

A service for converting between an address and a LatLng.

Access by calling const {Geocoder} = await google.maps.importLibrary("geocoding").
See Libraries in the Maps JavaScript API.

Geocoder
Geocoder()
Parameters:  None
Creates a new instance of a Geocoder that sends geocode requests to Google servers.
geocode
geocode(request[, callback])
Parameters: 
Return Value:  Promise<GeocoderResponse>
Geocode a request.

GeocoderRequest interface

google.maps.GeocoderRequest interface

The specification for a geocoding request to be sent to the Geocoder.

address optional
Type:  string optional
Address to geocode. One, and only one, of address, location and placeId must be supplied.
bounds optional
LatLngBounds within which to search. Optional.
componentRestrictions optional
Components are used to restrict results to a specific area. A filter consists of one or more of: route, locality, administrativeArea, postalCode, country. Only the results that match all the filters will be returned. Filter values support the same methods of spelling correction and partial matching as other geocoding requests. Optional.
BetaextraComputations optional
Type:  Array<ExtraGeocodeComputation> optional
A list of extra computations which may be used to complete the request. Note: These extra computations may return extra fields on the response.
fulfillOnZeroResults optional
Type:  boolean optional
Fulfill the promise on a ZERO_RESULT status in the response. This may be desired because even with zero geocoding results there may still be additional response level fields returned.
language optional
Type:  string optional
A language identifier for the language in which results should be returned, when possible. See the list of supported languages.
location optional
Type:  LatLng|LatLngLiteral optional
LatLng (or LatLngLiteral) for which to search. The geocoder performs a reverse geocode. See Reverse Geocoding for more information. One, and only one, of address, location and placeId must be supplied.