Adding Custom Layers

Adding AMP layers that are not offered in AIM's pre-built weather overlays is simple. By utilizing the AerisJS library, which powers AIM, custom layers can be easily added to the modules.layers.objects array.

Starting with a basic example in the modules.layers.object configuration, here is what pulling in the Radar and Advisories pre-built options would look like:

Basic Example


{
    type: 'Radar',
    selected: true
},
{
    type: 'Advisories',
    selected: false
}

Now let's replace the pre-built Radar option with AMP's new Radar-2m option:

Custom Radar-2m Option


{
    label: 'Radar-2m',
    // set the icon you wish to display
    icon: 'radar',
    // adding custom layers via AerisJS
    layer: new aeris.maps.layers.AerisTile({
        name: 'Radar 2m',
        tileType: 'radar-2m',
        apiId: 'CLIENT_ID',
        apiSecret: 'CLIENT_SECRET',
        // customize how often new layers are fetched from AMP servers
        autoUpdateInterval: 300 * 1000
    }),
    selected: true
},
{
    type: 'Advisories',
    selected: false
}

Last modified: February 13, 2018