Home > @magiclane/maps-sdk > Warning > (constructor)
Warning.(constructor)
Creates a Warning instance.
Signature:
constructor(type: string, name: string, severity: string, phenomenon: string, description: string, area: string, startStamp: Date | undefined, endStamp: Date | undefined, color: Color, coverage: Marker[]);Parameters
Parameter | Type | Description |
|---|---|---|
type | string | Encoded warning code " |
name | string | Display name translated according to current language (hazard text with the severity word substituted). Empty if the hazard code is not known by the local weather resource - use phenomenon as fallback |
severity | string | Severity word; translated according to current language when the severity code is known by the local weather resource, otherwise the server provided wording (English) |
phenomenon | string | Provider phenomenon text (source language, as sent by the weather provider) |
description | string | Provider description text (source language, as sent by the weather provider) |
area | string | Area / region name from the provider |
startStamp | Date | undefined | Warning validity interval start (UTC); undefined if not provided |
endStamp | Date | undefined | Warning validity interval end (UTC); undefined if not provided |
color | Warning color | |
coverage | Marker[] | Coverage polygons; populated only when the warnings coverage geometry was requested (CoverageGeometry.polygons). Every Marker holds one polygon: part 0 is the outer ring, the following parts are the holes. Rings are closed (first point repeated as the last), as published by the weather provider |