The Tropical view displays a variety of view types depending on the desired output using the viewType
configuration option.
JavaScript: | aeris.wxblox.views.Tropical |
Server Path: | tropical/active, tropical/archive, tropical/track/:id |
Data API/AMP Usage: | 1 /tropicalcyclones call + requested AMP Map Units |
Supported Plans | API Premium,  API Developer |
The following configuration options are supported by this view:
The following methods are supported by instances of this view (JavaScript method only):
enabled() |
[boolean] Whether or not the component is currently enabled. When false, the component will not be rendered and data required for the component will not be requested. |
hide() |
Hides the component's DOM element. |
isMetric() |
[boolean] Whether or not the component is currently displaying Metric units. |
load(:object) |
Requests data required by the component and renders the result. For components that don't require remote data requests, this method will call render() immediately. An optional object of request parameters can be provided to use for the request. |
params() |
[object] Returns the latest request parameters used when loading data. |
refresh() |
Re-renders the component using the cached data that was previously loaded. |
rendered() |
[boolean] Whether or not the component has rendered. |
setMetric(:boolean) |
Convenience method for setUnits() to toggle Metric units, where true sets the component's units to Metric and false uses Imperial. |
setUnits(:number) |
Updates the unit type being displayed by the component, where 0 is Imperial and 1 is Metric. |
show() |
Shows the component's DOM element. |
units() |
[number] The current unit type being displayed, where 0 is Imperial and 1 is Metric. |
The following events are triggered by instances of this view (JavaScript method only):
change:units |
Triggered when the component's unit type has changed (e.g. metric or imperial). |
load:done |
Triggered after the component's data has loaded but before rendering the component. |
load:error |
Triggered when an error occurs while requesting the component's data. |
load:start |
Triggered immediately before the component's data request begins loading. |
render |
Alias for render:after. |
render:after |
Triggered after the component has rendered and any additional DOM elements and/or events have been setup as needed for the component. |
render:before |
Triggered immediately before the component is rendered, allowing you to access and modify the data used in the template before getting rendered. |
Use the following examples to assist with getting started using this view. Select your WeatherBlox integration method for example code specific to that usage.
The first example below can be pasted into the body of your HTML document. For each additional snippet, you can replace the snippet within the first example which is located between the JavaScript comments.
Display the active tropical systems for the current season in a single listing:
<link href="https://cdn.aerisapi.com/wxblox/latest/aeris-wxblox.css" rel="stylesheet"/>
<script src="https://cdn.aerisapi.com/wxblox/latest/aeris-wxblox.js"></script>
<!-- DOM target where the WeatherBlox view will be rendered -->
<div id="wxblox"></div>
<script>
const aeris = new AerisWeather('CLIENT_KEY', 'CLIENT_SECRET');
aeris.on('ready', () => {
// Insert view / layout code below
var view = new aeris.wxblox.views.Tropical('#wxblox');
view.load();
// End view / layout code
});
</script>
Display the active tropical systems for the current season in a tabbed format:
var view = new aeris.wxblox.views.Tropical('#wxblox', {
show: {
tabbed: true
}
});
view.load();
Display all tropical systems for the current season in a single listing:
var view = new aeris.wxblox.views.Tropical('#wxblox', {
viewType: 'archive'
});
view.load();
Display all tropical systems for 2005 in a tabbed format:
var view = new aeris.wxblox.views.Tropical('#wxblox', {
viewType: 'archive',
year: '2005'
});
view.load();
Display the full track for a specific tropical system (example uses Katrina):
var view = new aeris.wxblox.views.Tropical('#wxblox', {
viewType: 'track'
});
view.load({
p: '2005-AL-12'
});
Display the active tropical systems for the current season in a single listing:
$view = new Aeris\WxBlox\View(‘views/tropicalcyclones’);
$content = $view->html();
echo $content;
Display the active tropical systems for the current season in a tabbed format:
$view = new Aeris\WxBlox\View(‘views/tropical’, array(
‘show’ => array(
‘tabbed’ => true
)
));
$content = $view->html();
echo $content;
Display all tropical systems for the current season in a single listing:
$view = new Aeris\WxBlox\View(‘views/tropical’, array(
‘viewType’ => array(‘archive’)
);
$content = $view->html();
echo $content;
Display all tropical systems for 2005 in a tabbed format:
$view = new Aeris\WxBlox\View(‘views/tropical’, array(
‘viewType’ => array(‘archive’),
‘year’ => array(‘2005’)
);
$content = $view->html();
echo $content;
Display the full track for a specific tropical system (example uses Katrina):
$view = new Aeris\WxBlox\View(‘views/tropical’, ‘2005-AL-12’ array(
‘viewType’ => array(‘track’)
);
$content = $view->html();
echo $content;
Display the active tropical systems for the current season in a single listing:https://wxblox.aerisapi.com/[api_key]/[secret_key]/views/tropical/active
Display the active tropical systems for the current season in a tabbed format:https://wxblox.aerisapi.com/[api_key]/[secret_key]/views/tropical/?opts=%7B%22show%22%3A%7B%22tabbed%22%3Atrue%7D%7D
Display all tropical systems for the current season in a single listing:https://wxblox.aerisapi.com/[api_key]/[secret_key]/views/tropical/?opts=%7B%22viewType%22%3A%22archive%22%7D
Display all tropical systems for 2005 in a tabbed format:https://wxblox.aerisapi.com/[api_key]/[secret_key]/views/tropical/?opts=%7B%22viewType%22%3A%22archive%22%2C%20%22year%22%3A%222005%22%7D
Display the full track for a specific tropical system (example uses Katrina):https://wxblox.aerisapi.com/[api_key]/[secret_key]/views/tropical/2005-AL-12?opts=%7B%22viewType%22%3A%22track%22%7D
Last modified: March 02, 2020