The Tropical module consists of several modules as part of a module group. To reduce the file size of your SDK application, these modules can be lazy-loaded. This is where we will override the default styles with our own custom ones. Note that we provide a reference to the built-in utility functions in the Tropical module. These helper functions will make our custom styling life easier.
Overriding the default styling is quite simple. All you have to do is provide your own style config object when loading a certain module. In the example below, we are lazy-loading the Tropical module and then providing said style config object.
This will implement the custom styles to plot a tropical cyclone similar to the following image:
That was easy. Now let’s take our customization further by adding date labels and storm icons along the forecast track. We will need to create a utility function that determines the icon and date labels and then pass that into our custom style config as the marker.
This will result in our image now including icons (based on the forecast intensity) and date labels at each forecast point instead of a circle.
The getStormMarkerConfig function used to customize the forecast point icons and labels can be found in the full example below.