Weather Alerts
The Weather Alerts layer displays overlays for various types of weather alerts. (North America only) The controls listed below can be used to interact with the Weather Alerts layer.
Set the visibility of the weather alert layer.
myMap.setWeatherAlertVisibility(true);
Get the visibility of the weather alert layer.
const alertVisible = myMap.isWeatherAlertVisible();
Toggle the visibility of the weather radar layer.
myMap.toggleWeatherAlertVisibility();
Weather Alert Click Control
The click control makes the weather alerts on the map clickable. A popup with alert details is shown when the alert is clicked.
var ctrl = new TrimbleMaps.WeatherAlertClickControl();
myMap.addControl(ctrl);
Weather Alert Legend Control
(Deprecated in v3.12. Use WeatherAlertFilterControl
)
var ctrl = new TrimbleMaps.WeatherAlertLegendControl();
myMap.addControl(ctrl);
Weather Alert Filter Control
var ctrl = new TrimbleMaps.WeatherAlertFilterControl();
myMap.addControl(ctrl);
The Weather Alert Filter control can also accept parameters to set the filters and control visibility.
Parameter | Type | Description |
---|---|---|
severity
|
string | Default: All Filters results based on the alert severity.
|
urgency
|
string | Default: All Filters results based on the alert urgency.
|
certainty
|
string | Default: All Filters results based on the alert certainty.
|
eventNames
|
array | Array of event names. |
isVisible
|
boolean | Default: true Controls the visibility of the selection controls. |
var ctrl = new TrimbleMaps.WeatherAlertFilterControl({
severity: "Moderate",
isVisible: false
});
myMap.addControl(ctrl);