Class GoogleMapsClient
- Namespace
- GoogleMapsApi
- Assembly
- GoogleMapsApi.dll
Instance-based Google Maps client driven by an injected HttpClient.
It is friendly to IHttpClientFactory, supports per-instance event handlers, and
avoids the testability problems of static state.
public sealed class GoogleMapsClient : IGoogleMapsClient
- Inheritance
-
GoogleMapsClient
- Implements
- Inherited Members
Constructors
GoogleMapsClient(HttpClient)
Creates a client that uses the supplied HttpClient with default options
(no ambient API key — callers must set ApiKey on each request).
public GoogleMapsClient(HttpClient httpClient)
Parameters
httpClientHttpClient
GoogleMapsClient(HttpClient, GoogleMapsClientOptions)
Creates a client that uses the supplied HttpClient and options.
public GoogleMapsClient(HttpClient httpClient, GoogleMapsClientOptions options)
Parameters
httpClientHttpClientThe HTTP client used for every API call. Typically obtained from
IHttpClientFactory.optionsGoogleMapsClientOptionsAmbient options applied to every request (e.g. default API key).
Properties
AddressValidation
Validate a postal address (Address Validation API). Supports USPS CASS for US/PR addresses.
public IEngineFacade<AddressValidationRequest, AddressValidationResponse> AddressValidation { get; }
Property Value
Directions
Perform directions operations.
public IEngineFacade<DirectionsRequest, DirectionsResponse> Directions { get; }
Property Value
DistanceMatrix
Retrieve duration and distance values based on the recommended route between start and end points.
public IEngineFacade<DistanceMatrixRequest, DistanceMatrixResponse> DistanceMatrix { get; }
Property Value
Elevation
Perform elevation operations.
public IEngineFacade<ElevationRequest, ElevationResponse> Elevation { get; }
Property Value
Geocode
Perform geocoding operations.
public IEngineFacade<GeocodingRequest, GeocodingResponse> Geocode { get; }
Property Value
PlaceDetailsNew
Fetch rich details about a single place via the Places API (New).
public IEngineFacade<PlaceDetailsRequest, Place> PlaceDetailsNew { get; }
Property Value
PlacePhoto
Resolve a place photo reference to an image URI via the Places API (New).
public IEngineFacade<PlacePhotoRequest, PlacePhotoResponse> PlacePhoto { get; }
Property Value
PlacesAutocompleteNew
Get place/query predictions for typed input via the Places API (New).
public IEngineFacade<AutocompleteRequest, AutocompleteResponse> PlacesAutocompleteNew { get; }
Property Value
PlacesSearchNearby
Search for places near a location via the Places API (New).
public IEngineFacade<SearchNearbyRequest, SearchNearbyResponse> PlacesSearchNearby { get; }
Property Value
PlacesSearchText
Search for places by free-text query via the Places API (New).
public IEngineFacade<SearchTextRequest, SearchTextResponse> PlacesSearchText { get; }
Property Value
Routes
Compute routes via the Routes API — the modern replacement for the Directions API.
public IEngineFacade<RoutesRequest, RoutesResponse> Routes { get; }
Property Value
TimeZone
Retrieve time zone data for a coordinate.
public IEngineFacade<TimeZoneRequest, TimeZoneResponse> TimeZone { get; }