Class ElevationService
- Namespace
- TMS.Maps.Elevation
- Assembly
- TMS.Maps.Elevation.dll
Retrieves elevation data for one or more geographic coordinates using a configurable mapping provider.
public sealed class ElevationService : ServiceBase, IElevationService, IDisposable
- Inheritance
-
ElevationService
- Implements
Constructors
- ElevationService(Providers, string?, HttpClient?, IHttpClientFactory?, IProviderFactory?, ILogger<ServiceBase>?)
Initializes a new instance of the ElevationService class for the specified provider.
Properties
- ApiKey
Gets or sets the API key used to authenticate requests to the selected provider.
- Provider
Gets or sets the mapping provider used to resolve elevation data. Setting this value recreates the underlying provider using the current ApiKey.
Methods
- Dispose()
Releases the resources used by the service, including the owned HttpClient.
- GetAsync(IEnumerable<Coordinate>, CancellationToken)
Retrieves elevation data for the specified set of coordinates.
- GetAsync(double, double, CancellationToken)
Retrieves elevation data for the specified latitude and longitude.
- GetAsync(Coordinate, CancellationToken)
Retrieves elevation data for a single coordinate.
- GetAsync<T>(IEnumerable<Coordinate>, CancellationToken)
Retrieves elevation data for the specified set of coordinates and casts each result to the requested type.
- GetAsync<T>(double, double, CancellationToken)
Retrieves elevation data for the specified latitude and longitude and casts each result to the requested type.
- GetAsync<T>(Coordinate, CancellationToken)
Retrieves elevation data for the specified coordinate and casts each result to the requested type.