Komponenty Delphi pomoc
Start › Komponenty Delphi › TWeather

TWeather

Pogoda na mapie: ikony i temperatura na obszarach (skórki iOS glass / Android / custom); JSON z weather.imetroll.com (current / godzinowo / 7 dni).

VCLFMXniewidoczny
▶ Zobacz na żywo – demo HTML

Opis

Komponent niewidoczny z palety „Maps”. Pobiera prognozę z serwera https://weather.imetroll.com/v1/forecast. Przyjmuje parametry od programisty, dokleja key= (ApiKey), wysyła GET, zwraca JSON w OnDataReady / DataJSON. Mapa z WeatherInfo=True rysuje ikonę + temperaturę na obszarze. Wykresy Chart.js nie są rdzeniem TWeather — używaj innych komponentów / własnego UI.

Moduł: MapCommon.Weather (+ Weather.Types / Area / Client / Colors / Overlay / AreaResolve) · Klasa bazowa: TComponent · Platformy: VCL + FMX

TWeather – podgląd poglądowy
Ikony + temperatura na obszarach (ShowAreaLabels): emoji/WMO + °C, motion pulse/wave, ScaleFactor przy szerokości ≥ MinScreenWidth. Map.WeatherInfo steruje, czy mapa w ogóle rysuje pogodę z JSON. Podgląd poglądowy (nie zrzut z Delphi) – prawdziwa strona mapy komponentu w ramce imitującej formę.

Demo na żywo

Dwa dema middleware: ikony+temp na obszarach z JSON; surowy JSON do aplikacji. Nakładka gradient + modal wykresów pozostaje jako przykład opcjonalny.

Zaznacz prostokąt / koło lub wpisz lat, lon[, km] → GET /v1/area. DensityMode=admin: ikona = WinningBit (WBS_*), temp = średnia — nie mean(WMO).

▶ Active + zaznaczenie / współrzędne + głosy ikony

Scene+HourStrip+DayItems+Chart; nie MapInfoWindow.

▶ TWeatherPopup — pełne okno prognozy

TWeather + HourStrip/DayItems/Chart wypełniają gotowe okno prognozy.

▶ Klik obszaru → okno prognozy

Fetch JSON → setWeather mode=labels (icon+°C, pulse, ScaleFactor/MinScreenWidth). Map.WeatherInfo.

▶ Ikony + temp na obszarach

Klik → GET + key= → surowy JSON current/hourly/daily (temp, wilgotność, wiatr, UV, feels-like, is_day).

▶ Middleware JSON (aplikacja)

Województwo → JSON do dalszego kodu (bez Chart.js jako rdzenia).

▶ Klik obszaru → JSON

Starszy przykład gradient/piksele + modal Dziś/7 dni (wykresy ≠ rdzeń TWeather).

▶ Opcjonalnie: gradient + modal

Weather ↔ Scene: ApplyJSON / SceneJSON (dzień/noc, chmury, deszcz, gwiazdy) — bez GET w Scene.

▶ TWeatherScene – animacja tła

Funkcje

Co wysłać / co wraca — zobacz sekcję I/O poniżej i przykłady kodu.
Bez ApiKey → wekUnauthorized (klient) lub HTTP 401 (serwer).
Moduł RTL (bez VCL/FMX); paleta Maps; pakiet MapComponentsRT.
Etap 2c (roadmap): precip intensity + cloud-cover gradient na tile/raster 2D; w 3D żywe chmury + rain layer — po middleware/ikonach.

Właściwości

WłaściwośćOpis
ApiKey / KeyKlucz API; doklejany jako &key= (ApiKeyParam domyślnie key).
RequireApiKeyTrue (domyślnie) = blokada Request/Refresh bez klucza.
ForecastKindwfkCurrent / wfkHourly / wfkDaily7.
Arealat/lon (wakPoints), bbox, kraj, województwo, polygon.
UseMapAreaSelection, AutoRequestOnAreaSelect, ShowAreaOnMapZaznaczenie mapy / współrzędne → Area; Active=True → RefreshAsync (domyślnie True).
IntervalAlias AutoRefreshMinutes — timer cykliczny (minuty).
BaseURL, Parameters, Sections, ForecastDaysNiskopoziomowe opcje Open-Meteo (Sections uzupełnia ForecastKind).
MapTTileMap*/T3DMap*; AutoLink + reverse Map.Weather.
Map.WeatherInfoNa mapie: True = rysuj pogodę z JSON (ikony/nakładka).
Display.ShowAreaLabelsIkona + temperatura na punktach i obszarach.
Display.LabelDensity0 rzadko / 1 normalnie / 2 gęsto — rzadziej etykiety przy oddaleniu.
Display.DensityModewdnmAdmin / wdnmGrid / wdnmAuto — admin=1/jednostka+centroid (ikona = WinningBit głosów WBS_*, temp = średnia); grid=MaxPoints/PointsPerAdmin; auto wg zoomu.
PointsPerAdminLimit punktów/widgetów na jednostkę admin w trybie grid (0 = tylko MaxPoints).
WidgetStyleStyl CreateWidget: BackgroundColor, TextColor, BorderColor/Width/Radius, Opacity, FontSize/Weight, Padding, Shadow.
Map.WeatherClickModewcmAuto / AreaAverage / Point — klik: średnia+centroid obszaru vs punkt+Nominatim; Auto wg widocznego admin zoom.
Map.WeatherPointModeMinZoomZoom, od którego Auto = punkt (domyślnie 8; dopasuj do MaxZoom stylu granic).
Display.IconMotionwimStatic / wimPulse / wimWave.
Display.LabelChromewlcIconLabelBackground / wlcLabelsOnly.
Display.Opacity, ScaleFactor, MinScreenWidthKrycie; skala ikon; poniżej MinScreenWidth bez powiększania, powyżej — ScaleFactor.
Display.UseCustomIcons, CustomIconsWłasne PNG (WMO code=url) zamiast emoji.
Display (gradient)ShowAreaLabels=False → wdmGradient/wdmPixels + legenda (opcjonalnie).
ChartsOpcjonalne (demoted); domyślnie wyłączone.
Areas, AutoLinkComponentsKontury województw; auto-link formy.
SceneTWeatherScene — chrome animacji; reverse Scene.Weather; Scene nie woła serwera.
HeaderTWeatherHeader — nagłówek okna (ikona + obszar); klik ikony → HourStrip.
WidgetStyle.Theme / Blur / Border*Skórka iOS/Android/custom dla pigułek na mapie (glass + obramowanie).

Zdarzenia

ZdarzenieOpis
OnDataReady(JSON)Po udanym Request/RefreshAsync — middleware JSON (current/hourly/daily + icon).
OnErrorwekUnauthorized, sieć, timeout, obszar…
OnProgressPostęp partii przy wielu punktach.
OnResolveAreaDostarczenie GeoJSON konturu.
OnChartsRequestOpcjonalnie (Charts.ShowOn*); preferuj zdarzenia mapy + DataJSON.
OnAreaAppliedArea podmienione z mapy / współrzędnych (przed zapytaniem).
Map.OnMapClick / Areas.OnAreaClickInterakcja myszy/dotyku — programista woła TWeather.

Metody

MetodaOpis
Request / Refresh / RefreshAsync / CancelBudowa GET+key=; synchronicznie / async; anulowanie.
DataJSONOstatni JSON middleware (jak argument OnDataReady).
BeginAreaSelect(Shape) / CancelAreaSelectRysowanie prostokąta / koła / wielokąta na mapie (pan-lock).
ApplyMapArea(Area) / ApplyCoords(Lat, Lon, RadiusKm=0) / ApplyCoordsText / ApplyBoundsObszar z mapy / współrzędnych; Active → RefreshAsync.
UpdateDisplay / ClearDisplayPonowne wypchnięcie / ukrycie ikon lub gradientu (gdy WeatherInfo).
CreateWidget / CreateWidgetAtCentroidJedna etykieta ikona+wartość na lat/lon lub centroida obszaru (OnWidgetContent).
CreateWidgetsForAreas / ClearWidgetsWiele widgetów na centroidach FeatureCollection; ClearWidgets = ClearDisplay.
EffectiveDensityModeDensityMode po resolve względem aktualnego WeatherClickTarget.
DetectLinkedComponentsPonowne Map / Areas.
ChartsJSON*Opcjonalne serie pod własne wykresy.

Przykłady

TWeather middleware + ikony + ScaleFactor

// Middleware: ApiKey wymagany; ForecastKind; ikony+temp na obszarach
// Map.WeatherInfo = True → mapa rysuje JSON; Display.ScaleFactor / MinScreenWidth
procedure TForm1.FormCreate(Sender: TObject);
begin
  Weather1.ApiKey := GetEnvironmentVariable('WEATHER_API_KEY'); // doklejane jako &key=
  Weather1.RequireApiKey := True;
  Weather1.ForecastKind := wfkDaily7;          // current / hourly / daily7
  Weather1.Area.Kind := wakRegion;
  Weather1.Area.RegionName := 'mazowieckie';
  Weather1.Interval := 30;                     // alias AutoRefreshMinutes (aplikacja cykliczna)
  TileMap1.Weather := Weather1;
  TileMap1.WeatherInfo := True;                // mapa ma rysować pogodę z JSON
  Weather1.Display.ShowAreaLabels := True;     // ikona + temperatura na obszarze
  Weather1.Display.IconMotion := wimPulse;     // wimStatic / wimWave
  Weather1.Display.LabelChrome := wlcIconLabelBackground; // lub wlcLabelsOnly
  Weather1.Display.Opacity := 0.95;
  Weather1.Display.ScaleFactor := 1.4;         // skalowanie ikon na większym ekranie
  Weather1.Display.MinScreenWidth := 768;      // poniżej = bez powiększania
  Weather1.OnDataReady := Weather1DataReady;
  Weather1.OnError := Weather1Error;
  Weather1.Request;                            // alias Refresh; lub RefreshAsync
end;

OnDataReady(JSON) / OnError

procedure TForm1.Weather1DataReady(Sender: TObject; const JSON: string);
begin
  MemoRaw.Text := JSON;   // current / hourly / daily + icon (jak odpowiedź serwera)
  // albo Weather1.DataJSON; ikony już na mapie gdy WeatherInfo + ShowAreaLabels
end;

procedure TForm1.Weather1Error(Sender: TObject; Kind: TWeatherErrorKind;
  const ErrorMessage: string);
begin
  Memo1.Lines.Add('TWeather: ' + ErrorMessage);  // wekUnauthorized bez ApiKey
end;

Co wysłać / co wraca (I/O serwera)

// Co wysłać DO TWeather → co wraca z serwera (middleware)
// 1) Programista ustawia: ApiKey/Key, ForecastKind, Area (lat/lon lub region), Parameters
// 2) TWeather buduje GET na https://weather.imetroll.com/v1/forecast?...&key=APIKEY
// 3) OnDataReady(JSON) / DataJSON — pola current/hourly/daily jak Open-Meteo

// Przykład URL (klucz zawsze na końcu):
// GET /v1/forecast?latitude=52.23&longitude=21.01
//   &current=temperature_2m,...,uv_index,wind_speed_10m,wind_direction_10m,
//            sunshine_duration,shortwave_radiation,is_day
//   &hourly=...&daily=...&forecast_days=7&timezone=auto&key=***

// JSON (skrót): current.temperature_2m, .weather_code, .apparent_temperature (feels-like),
//   .uv_index, .wind_speed_10m, .wind_direction_10m,
//   .sunshine_duration (nasłonecznienie [s]), .shortwave_radiation (W/m²),
//   .is_day; hourly.*; daily.* + shortwave_radiation_sum; + "icon"

Weather1.ForecastKind := wfkHourly;
Weather1.Area.Kind := wakPoints;
Weather1.Area.Points.Text := '52.23,21.01';
Weather1.RefreshAsync;

Zdarzenia mapy/obszaru

// Zdarzenia mapy/obszaru (programista obsługuje — TWeather nie jest modułem wykresów)
// Lewy klik obszaru:  TMapAreas.OnAreaClick
// Lewy klik mapy:     Map.OnMapClick
// Prawy / long-press: edycja obszaru gdy Areas.EditPopupEnabled (contextmenu / touch)
// Dblclick:           zaznaczanie poligonu w trybie rysowania mapy
//
// W handlerze: ustaw Area na punkt/region → Request/RefreshAsync → OnDataReady(JSON)
procedure TForm1.Areas1AreaClick(Sender: TObject; const SetId: string;
  const Lat, Lon: Double; const CountryISO2, FeatureName, PropertiesJSON: string);
begin
  Weather1.Area.Kind := wakPoints;
  Weather1.Area.Points.Text := Format('%.5f,%.5f', [Lat, Lon]);
  Weather1.RefreshAsync;
end;

Prezentacja: motion, chrome, custom PNG, skala

// prezentacja bez nowego zapytania
Weather1.Display.IconMotion := wimWave;
Weather1.Display.LabelChrome := wlcLabelsOnly;
Weather1.Display.ScaleFactor := 1.6;
Weather1.Display.MinScreenWidth := 600;
TileMap1.WeatherInfo := True;
Weather1.UpdateDisplay;

// własne PNG zamiast emoji (WMO code = URL / data:image/png;base64,…)
Weather1.Display.UseCustomIcons := True;
Weather1.Display.CustomIcons.Text :=
  '0=https://cdn.example/sun.png' + sLineBreak +
  '3=https://cdn.example/cloud.png';
Weather1.UpdateDisplay;

Parsowanie JSON middleware

// Middleware: OnDataReady(JSON) — surowy + pola
procedure TForm1.Weather1DataReady(Sender: TObject; const JSON: string);
var
  Root: TJSONValue;
  Cur: TJSONObject;
begin
  MemoRaw.Text := JSON;
  Root := TJSONObject.ParseJSONValue(JSON);
  try
    Cur := (Root as TJSONObject).GetValue('current') as TJSONObject;
    if Cur <> nil then
      Caption := Format('%.0f °C  %s', [
        Cur.GetValue('temperature_2m').AsDouble,
        (Root as TJSONObject).GetValue('icon').Value]);
  finally
    Root.Free;
  end;
end;

Ikona obszaru: głosy binarne (WBS_* / WinningBit)

// Ikona obszaru = głosy binarne (potęgi 2), NIE średnia kodów WMO
// WBS_CLEAR=1, WBS_SUN=2, WBS_CLOUDS=4, WBS_RAIN=8
procedure TForm1.ShowAreaIcon;
var
  Votes: TWeatherBinaryVotes;
  Win: Integer;
  TempC: Double;
  Icon: string;
begin
  // Weather1.Display.DensityMode := wdnmAdmin;  // 1 widget / województwo
  // po Refresh / OnDataReady:
  Votes := Weather1.Data.AreaBinaryVotes;          // lub AreaBinaryVotes(UsePointMask)
  Win := Votes.WinningBit;                         // remis: rain > clouds > sun > clear
  TempC := Weather1.Data.AverageCurrent(wpTemperature2m);
  Icon := WeatherBinaryStateIcon(Win, True, TempC); // = WeatherIconEmoji(WMO 0/1/3/61, …)
  Memo1.Lines.Add(Format(
    'CLEAR=%d SUN=%d CLOUDS=%d RAIN=%d SumBits=%d WinningBit=%d → %s %.0f°C',
    [Votes.Clear, Votes.Sun, Votes.Clouds, Votes.Rain, Votes.SumBits, Win, Icon, TempC]));
  // CreateWidgetAtCentroid używa tego samego: ikona=WinningBit, temp=średnia
  Weather1.CreateWidgetAtCentroid('mazowieckie');
end;

// Mapowanie WMO → bit (WeatherCodeToBinaryState):
//   0 → CLEAR, 1 → SUN, 2..48 → CLOUDS, ≥51 → RAIN
// AverageCurrent(wpWeatherCode) zwraca WMO zwycięskiego bitu (0/1/3/61), nie mean(codes).

Opcjonalne Charts (nie rdzeń)

// OPCJONALNIE — wykresy to inne komponenty / własne UI (Charts demoted)
Weather1.Charts.Enabled := True;
Weather1.Charts.ShowOnAreaClick := True;
Weather1.OnChartsRequest := Weather1ChartsRequest;

Active: zaznaczenie obszaru lub współrzędne → automatyczne zapytanie

Weather1.Active = True na mapie: wybór obszaru (przycisk nawigacji Zaznacz obszar, BeginAreaSelect; mysz lub palec, pan/drag mapy zablokowany) albo współrzędne (ApplyCoords / ApplyCoordsText / ApplyBounds) od razu wysyła zapytanie (RefreshAsync) do weather.imetroll.com. Zapytanie trwające dla starego obszaru jest porzucane / anulowane. Active = False → zmienia się tylko Area; zapytanie wywołujesz sam (Request).

Źródło obszaruTWeather.AreaZapytanie (Active=True)
Prostokąt narysowany na mapiewakBBox + South/West/North/Eastsiatka w prostokącie
Koło narysowane na mapiewakPolygon (koło → GeoJSON)siatka punktów przycięta do koła
ApplyCoords(Lat, Lon, RadiusKm)wakPolygon (koło → GeoJSON)siatka w kole
ApplyCoords(Lat, Lon) (bez promienia)wakPoints – 1 punktjedna prognoza
ApplyCoordsText(Edit1.Text)"52.23, 21.01, 50" · "52,23; 21,01; 50" · "52.23 21.01 50km" · "lat=52.2 lon=21 r=30" (promień opcjonalny); False = nie rozpoznano (+ OnError)
ApplyBounds(S, W, N, E)wakBBoxsiatka w prostokącie
Właściwość / zdarzenieOpis
UseMapAreaSelection (True)Zaznaczenie na mapie podmienia Area.
AutoRequestOnAreaSelect (True)Przy Active=True: nowy obszar → RefreshAsync. False = tylko Area.
ShowAreaOnMap (True)ApplyCoords / ApplyBounds rysują obszar na mapie (bez ponownego areaSelected).
OnAreaAppliedPo podmianie Area (przed zapytaniem).

Map.OnAreaSelected pozostaje Twoim zdarzeniem: TAircraft, TBoats i TWeather słuchają tej samej mapy równolegle (TMapCore.AddAreaSelectedListener, multicast) – jedno zaznaczenie może zasilić wszystkie trzy.

Weather1.Active := True;
Weather1.BeginAreaSelect;                      // rysuj na mapie → zapytanie
Weather1.ApplyCoords(52.23, 21.01, 40);            // współrzędne + promień [km] → zapytanie
if not Weather1.ApplyCoordsText(Edit1.Text) then ShowMessage('lat, lon[, km]');

weather.imetroll.com/v1/area – pogoda dla obszaru (GET)

GET https://weather.imetroll.com/v1/area?…&key= – pogoda dla obszaru (siatka punktów w jednym zapytaniu do Open-Meteo). Brak obszaru → HTTP 400; nigdy cały świat.

TrybGETTWeather (Delphi)
rectanglelamin lomin lamax lomaxApplyBounds / prostokąt z mapy → wakBBox
radiuslat lon radius_kmApplyCoords(Lat, Lon, Km) / koło z mapy → wakPolygon
pointlat lonApplyCoords(Lat, Lon) → wakPoints
namedarea=mazowieckieGET /v1/area/areas (pl, warsaw, mazowieckie, malopolskie, pomorskie, tatry…)
ParametrOpis
grid_kmOczko siatki [km] (domyślnie auto)
max_pointsMaks. punktów (domyślnie 64, max 150; oczko rośnie)
current hourly daily forecast_days past_days timezone …Przekazywane do Open-Meteo (domyślnie current: temp, wilgotność, weather_code, zachmurzenie, opad, wiatr, is_day)
JSONOpis
bbox.moderectangle | radius | point (+ lamin…lomax, lat/lon/radius_km, area)
grid_km, count, upstream_msSiatka / liczba punktów / czas Open-Meteo
points[].lat, lon, grid_lat, grid_lon, elevationPunkt siatki + komórka modelu
points[].current / hourly / daily (+ *_units)Jak /v1/forecast

Delphi TWeather buduje siatkę po stronie klienta (GridResolutionKm, MaxPoints) i działa z każdym serwerem zgodnym z Open-Meteo; /v1/area służy aplikacjom HTML/JS i innym klientom.

Ikona obszaru (głosy binarne)

Przy DensityMode=admin / CreateWidgetAtCentroid / AreaAverage ikona nie jest średnią arytmetyczną weather_code (średnia 0 i 61 ≈ 30 — bez sensu). Zamiast tego:

  1. Każdy punkt próbki w poligonie (województwo) dostaje jeden bit stanu: WBS_CLEAR=1, WBS_SUN=2, WBS_CLOUDS=4, WBS_RAIN=8 (mapowanie WMO: 0→clear, 1→sun, 2…48→clouds, ≥51→rain).
  2. AreaBinaryVotes sumuje bity (SumBits) i liczy głosy per stan (Clear/Sun/Clouds/Rain).
  3. WinningBit = stan z największą liczbą głosów (remis: rain > clouds > sun > clear) → emoji / WMO reprezentatywne (0/1/3/61).
  4. Temperatura przy ikonie = zwykła średnia z próbek; pozycja = centroida poligonu (WeatherLabelAnchor).
BitWartośćWMO →Reprezentatywne WMOIkona
WBS_CLEAR1 = 2⁰00☀️
WBS_SUN2 = 2¹11🌤️
WBS_CLOUDS4 = 2²2…483☁️
WBS_RAIN8 = 2³≥51 (deszcz/śnieg/burza)61🌧️

API: TWeatherDataSet.AreaBinaryVotes, WeatherCodeToBinaryState, WeatherBinaryStateToWmoCode, WeatherBinaryStateIcon, AverageCurrent(wpWeatherCode) = WMO zwycięskiego bitu.

Votes := Weather1.Data.AreaBinaryVotes;
Win := Votes.WinningBit;                              // np. WBS_RAIN = 8
TempC := Weather1.Data.AverageCurrent(wpTemperature2m);
Icon := WeatherBinaryStateIcon(Win, True, TempC);
// CreateWidgetAtCentroid / PlaceMultiAreaWidgets robi to samo automatycznie
Weather1.Display.DensityMode := wdnmAdmin;
Weather1.CreateWidgetsForAreas;                       // 1 ikona / województwo

▶ Demo: Active + DensityMode=admin (głosy)

Kody WMO (weather_code)

Pole weather_code → WeatherIconEmoji / WeatherWmoCodeDesc. Rodzina UI: TWeatherScene, TWeatherHourStrip, TWeatherDayItems, TWeatherChart (AutoLink do TWeather, ApplyJSON na OnDataReady). Ikony: wbudowane albo UseCustomIcons + CustomIcons (code=url).

KodIkonaPLEN
0☀️BezchmurnieClear sky
1🌤️Przeważnie bezchmurnieMainly clear
2⛅Częściowo pochmurnoPartly cloudy
3☁️Zachmurzenie całkowiteOvercast
45🌫️MgłaFog
48🌫️Mgła szronowaDepositing rime fog
51🌦️Lekka mżawkaLight drizzle
53🌦️Umiarkowana mżawkaModerate drizzle
55🌧️Gęsta mżawkaDense drizzle
56🌧️Lekka marznąca mżawkaLight freezing drizzle
57🌧️Gęsta marznąca mżawkaDense freezing drizzle
61🌧️Słaby deszczSlight rain
63🌧️Umiarkowany deszczModerate rain
65🌧️Silny deszczHeavy rain
66🌧️Lekki marznący deszczLight freezing rain
67🌧️Silny marznący deszczHeavy freezing rain
71🌨️Słaby śniegSlight snow fall
73🌨️Umiarkowany śniegModerate snow fall
75❄️Silny śniegHeavy snow fall
77❄️Ziarnisty śniegSnow grains
80🌦️Słabe przelotne opadySlight rain showers
81🌧️Umiarkowane przelotne opadyModerate rain showers
82🌧️Gwałtowne przelotne opadyViolent rain showers
85🌨️Słabe przelotne opady śnieguSlight snow showers
86❄️Silne przelotne opady śnieguHeavy snow showers
95⛈️BurzaThunderstorm
96⛈️Burza z lekkim grademThunderstorm with slight hail
99⛈️Burza z silnym grademThunderstorm with heavy hail

▶ Demo: popup Scene + pasek + dane

Pełna lista API

Generowana z deklaracji w kodzie (Source/*.pas): wszystkie opublikowane właściwości i zdarzenia TWeather (także dziedziczone), właściwości publiczne i metody publiczne.

Właściwości opublikowane (41)

WłaściwośćTypDomyślnieOpis
ActiveBooleanFalse
BaseURLstringAdres serwera Nominatim
ApiKeystringKlucz API – tylko w kodzie, używany przez {apikey}
Keystring
ApiKeyParamstring
RequireApiKeyBooleanTrue
ParametersTWeatherParams
SectionsTWeatherSections[wsCurrent, wsHourly]
ForecastKindTWeatherForecastKindwfkHourly
AreaTWeatherAreaZaznaczony obszar (kształt, punkty, prostokąt, koło)
GridResolutionKmDouble
MaxPointsInteger400
PointsPerAdminInteger0
ForecastDaysInteger3
PastDaysInteger0
Timezonestring
TemperatureUnitTWeatherTemperatureUnitwtuCelsius
WindSpeedUnitTWeatherWindSpeedUnitwwuKmh
PrecipitationUnitTWeatherPrecipitationUnitwpuMm
Modelsstring
AutoRefreshMinutesInteger0
IntervalInteger
CacheTTLSecondsIntegerWEATHER_DEFAULT_CACHE_TTL_S
MinRequestIntervalMsIntegerMinimalny odstęp między zapytaniami (kolejka); Nominatim: 1000
TimeoutMsIntegerWEATHER_DEFAULT_TIMEOUT_MS
MaxRetriesIntegerWEATHER_DEFAULT_MAX_RETRIES
MaxPointsPerRequestInteger
AreasTMapAreasPowiązany komponent TMapAreas (granice, regiony, własne GeoJSON)
MapTComponent
SceneTComponent
HeaderTComponent
HourStripTComponent
DayItemsTComponent
PopupTComponent
AutoLinkComponentsBooleanTrueAutomatycznie łącz pierwszy dostawcę wyszukiwania / TMapAreas / TEditMap z formy
DisplayTWeatherDisplay
WidgetStyleTWeatherWidgetStyle
ChartsTWeatherCharts
UseMapAreaSelectionBooleanTrue
AutoRequestOnAreaSelectBooleanTrue
ShowAreaOnMapBooleanTrue

Zdarzenia (7)

ZdarzenieTypOpis
OnDataReadyTWeatherDataReadyEvent
OnErrorTWeatherErrorEventKażdy błąd (ErrorKind, HTTP, komunikat PL/EN)
OnProgressTWeatherProgressEvent
OnResolveAreaTWeatherResolveAreaEvent
OnChartsRequestTWeatherChartsRequestEvent
OnWidgetContentTWeatherWidgetContentEvent
OnAreaAppliedTNotifyEvent

Właściwości publiczne – tylko w kodzie (7)

WłaściwośćTypOpis
DataTWeatherDataSet
SamplePointsTWeatherLatLonArray
PointCountInteger
BusyBooleanTrwa zapytanie
LastErrorKindTWeatherErrorKind
LastErrorstring
LastRefreshTDateTime

Metody publiczne (35)

MetodaOpis
function Refresh: BooleanPonownie wczytuje hierarchię i pliki
function Request: Boolean
procedure RefreshAsync
procedure Cancel
function DataJSON: string
procedure ClearCacheUsuwa pliki z cache
function PointLatLon(PointIndex: Integer): TWeatherLatLon
function HourlyTimeCount: Integer
function HourlyTime(TimeIndex: Integer): string
function Value(PointIndex: Integer; P: TWeatherParam; TimeIndex: Integer): Double
function CurrentValue(PointIndex: Integer; P: TWeatherParam): Double
function MinMax(P: TWeatherParam; TimeIndex: Integer; out AMin, AMax: Double): Boolean
function NearestPoint(const Lat, Lon: Double): Integer
function ValueAt(const Lat, Lon: Double; P: TWeatherParam; TimeIndex: Integer = -1): Double
procedure RegisterLinkedView(View: TComponent)
procedure UnregisterLinkedView(View: TComponent)
procedure DetectLinkedComponentsWyszukuje na formie i łączy dostawcę / TMapAreas / TEditMap
function MapCore: TMapCoreIMapCoreProvider – rdzeń dla TEditMapRaster
procedure BeginAreaSelect(Shape: TMapAreaShape = masRectangle)
procedure CancelAreaSelect
procedure ApplyMapArea(const MapArea: TMapArea)
procedure ApplyCoords(const Lat, Lon: Double; const RadiusKm: Double = 0)
function ApplyCoordsText(const Text: string): Boolean
procedure ApplyBounds(const South, West, North, East: Double)
procedure UpdateDisplay
procedure ClearDisplay
procedure CreateWidgetAtCentroid(const AreaName: string = ''; const Admin: string = '')
procedure CreateWidgetsForAreas(const GeoJSON: string = '')
procedure ClearWidgets
function EffectiveDensityMode: TWeatherDensityMode
function OverlayGrid: TWeatherOverlayGrid
function HourlySeries(PointIndex: Integer; P: TWeatherParam): TArray<Double>
function HourlySeriesAt(const Lat, Lon: Double; P: TWeatherParam): TArray<Double>
function ChartsJSON(PointIndex: Integer): string
function ChartsJSONAt(const Lat, Lon: Double): string

Pełny opis wszystkich właściwości: dokumentacja komponentów map.

Zobacz też