Home > @magiclane/maps-sdk > WeatherService

WeatherService class

Service for retrieving weather forecasts and conditions.

This service provides methods to fetch current weather conditions, hourly forecasts, daily forecasts, and general weather data for specified geographic locations.

Weather

Signature:

export declare abstract class WeatherService 

Properties

Property

Modifiers

Type

Description

maxCoordinatesPerRequest

static

readonly

number

Gets the maximum number of coordinates allowed per request.

maxDayForDailyForecast

static

readonly

number

Gets the maximum number of days allowed per daily forecast request.

maxHoursForHourlyForecast

static

readonly

number

Gets the maximum number of hours allowed per hourly forecast request.

transferStatistics

static

readonly

TransferStatistics

Gets transfer statistics for weather service operations.

Returns a TransferStatistics object containing counters and metrics about network usage performed by the weather service. This information can be used for diagnostics or to display usage to end users.

Methods

Method

Modifiers

Description

cancel(listener)

static

Cancels an ongoing asynchronous weather operation.

getCurrent({ coords, onComplete, }, input)

static

Retrieves current weather for specified coordinates.

getDailyForecast({ days, coords, onComplete, }, input)

static

Retrieves daily weather forecast for specified coordinates.

getForecast({ coords, onComplete, }, input)

static

Retrieves weather forecast for coordinates at specified future times.

The duration in each WeatherDurationCoordinates specifies the time offset into the future for which the forecast is requested.

getHourlyForecast({ hours, coords, onComplete, }, input)

static

Retrieves hourly weather forecast for specified coordinates.