Map Viewer

Map Viewer

Object
aeris.wxblox.views.MapViewer
Data Usage
Raster Maps usage based on size of map and total layers.

A MapViewer view is responsible for displaying and managing a weather map consisting of one or more data layers. This view also handles animating weather data across a specific time range.

Map Viewer

Examples

Display a MapViewer component with navigation options to change the zoom level and layer data types centered on Austin, TX:

const view = new aeris.wxblox.views.MapViewer('#wxblox', {
    map: {
    loc: 'austin,tx',
        data: ['radar']
    },
    controls: {
        layers: [{
            value: 'radar',
            title: 'Radar'
        },{
            value: 'satellite',
            title: 'Satellite'
        },{
            value: 'alerts',
            title: 'Advisories'
        },{
            value: 'temperatures,clip-us-flat',
            title: 'Temps'
        }],
        regions: [{
            zoom: 7,
            title: 'Local'
        },{
            zoom: 5,
            title: 'Regional'
        },{
            region: 'us',
            title: 'National'
        }]
    }
});
view.load();

Configuration

The following configuration options are supported by this view:

OptionDescriptionDefault
mapType: object (undefined)Default map configuration``
map.layersType: object (undefined)The layer configuration for the map``
map.layers.baseType: array (undefined)An array of base map layer codes to render below all weather and overlay layers['flat']
map.layers.overlaysType: array (undefined)An array of overlay layer codes to render above all weather and base layers['admin']
map.layers.dataType: array (undefined)An array of supported weather layer codesundefined
map.centerType: string (undefined)The location to center the map onnull
map.zoomType: number (undefined)Map zoom level3
map.boundsType: string (undefined)[string] or [object] The bounds to use for the map as northwest and southeast coordinates either as a string, 56.26,-131.39,15.45,-61.17, or object, { north: 56.26, west: -131.39, south: 15.45, east: -61.17 }undefined
map.regionType: string (undefined)The key of a supported region to display for the map. See the regions documentation for the regions currently supported and their usage.undefined
map.size.widthType: number (undefined)[integer/auto] Map width in pixels (limited by your Aeris Maps level), or auto to have the width automatically set to fill the map container's width.auto
map.size.heightType: number (undefined)[integer/auto] Map height in pixels (limited by your Aeris Maps level), or auto to have the height automatically calculated based on the map container's width and the specified map.size.factor ratioauto
map.size.factorType: number (undefined)The scale factor to use when height is set to auto. The map height will be calculated by multiplying either the specified width value or DOM container's width by the factor value.0.75
map.offsetType: string (undefined)The time offset to display for single-interval maps. This does not affect animationsundefined
map.autoFutureType: boolean (undefined)Whether or not future layers corresponding to active layers defined in map.layers.data should automatically be included when the map's timeline includes future periods (e.g. fradar would be included if radar is active)true
map.combineType: boolean (undefined)Whether or not all specified layers specified by map.layers.data should be combined into a single image for each request. When false, the base overlay layers will be rendered into their own separate DOM containers below and above the map content respectively and will not be animated, which reduces the total map units used for a single animation. Set to true if you need your layers rendered in a unique order around the animated map layers.false
animationType: object (undefined)Configuration for the map animation``
animation.enabledType: boolean (undefined)Whether or not to enabled animation. If false, then the viewer will only display data for the current timetrue
animation.fromType: number (undefined)[number] or [date] Start time offset relative to now for the animation in seconds, or a valid Date instance; negative values are in the past-2 * 3600
animation.toType: number (undefined)End time offset relative to now for the animation in seconds, or a valid Date instance; negative values are in the past0
animation.durationType: number (undefined)Total duration of the animation in seconds; duration and intervals are both used to control the overall speed of the animation2
animation.endDelayType: number (undefined)Delay to hold the end of the animation before replaying from the beginning, in seconds1
animation.intervalsType: number (undefined)Total number of frames to use for the animation; duration and intervals are both used to control the overall speed of the animation such that a higher number of intervals will animate faster than a lower number of intervals for the same duration value10
animation.autoplayType: boolean (undefined)Whether or not the animation should automatically start playing initiallyfalse
animation.refreshType: number (undefined)How often the animation re-fetches data.300
overlaysType: object (undefined)Configuration for custom overlays rendered above the map``
overlays.titleType: string (undefined)he title to display over the map. Use CSS to style the title's DOM elements as neededundefined
overlays.timestampType: string (undefined)[string] or [object] A string value indicates the time and date format for the map's timeline during playback. Provide an object to include additional options.MM/DD/YYYY hh:mm A
overlays.timestamp.formatType: string (undefined)Time and date format for the map timeline during playback using moment.js formatting optionsundefined
overlays.timestamp.continuousType: boolean (undefined)Whether or not the timestamp should update continuously during playback regardless of frame intervals. If false, then the timestamp will only update when the animation's frame changestrue
overlays.brandingType: object (undefined)Map branding options``
overlays.branding.imgType: string (undefined)A URL to an image to display on the map, such as a company logo.undefined
overlays.branding.htmlType: string (undefined)An HTML string to display for the map branding, such as a company logo or name. Offers more flexible customization options than overlays.branding.img.undefined
selectorsType: object (undefined)Selectors for DOM render targets``
controlsType: object (undefined)Options for layers and regions navigation elements displayed within the viewer``
controls.layersType: array (undefined)An array of layer config objects to display in the layer selection navigationnull
controls.layers[#].valueType: string (undefined)The AerisMaps layer code``
controls.layers[#].titleType: string (undefined)The title to display for the layer``
controls.regionsType: array (undefined)An array of region config objects to display in the region selection navigationnull
controls.regions[#].zoomType: number (undefined)The map zoom level to use for the region``
controls.regions[#].locType: string (undefined)An optional location to center the map on for the region. If this value is not defined or null, then the value of map.loc will be used for this region's center location.``
controls.regions[#].titleType: string (undefined)The title to display for the region``
enabledType: boolean (undefined)Whether or not the view is enabled. If false then the view will not be rendered and data required for the view will not be requested. This option is typically only applicable for views contained within a parent layout.true
metricType: boolean (undefined)Whether or not to display units in metric. The method setUnits() can be used at runtime once a view has rendered to change the units currently displayed.false
renderNoDataType: boolean (undefined)Whether or not the view should be rendered if data was not returned or not available.true
requestType: object (undefined)An object containing the default Weather API request options to use for the views's data request where applicable. These parameters can also be overriden in the load(:params) method when rendering the view using the JavaScript method.``

Methods

The following methods are supported by instances of this view:

Events

The following events are triggered by instances of this view: