Module: eSvgMap

Methods

(static) eSvgMap(opts) → {module:eSvgMap~api}

Parameters:
Name Type Description
opts Object Initialisation options.
Properties
Name Type Description
selector string The CSS selector of the element which will be the parent of the SVG. (Default - body.)
mapid string The id for the map to be created. (Default - es=SvgMap.)
outputWidth number The width of the map in pixels. If this is set to zero then the width is set to the client width of the element indicated by the opts.selector parameter. (Default - 0.)
outputHeight number The height of the map in pixels. If this is set to zero then the height is set to the client height of the element indicated by the opts.selector parameter. (Default - 0.)
mapBB Array.<number> The MBR of an area that must be fully visible in the map to start. This iniitally positions the map view. The array has the form [minx, miny, maxx, maxy]. The numbers are in the coordinate system EPSG:3035 (ETRS89-extended / LAEA Europe) which is that used for the map. (Default - [1000000, 800000, 6600000, 5500000].)
expand boolean Indicates whether or not the map will expand to fill parent element. (Default - false.)
hightlightAllEurope boolean Indicates whether or not *all* European countries are to be highlighted.
highlightCountries Array.<string> An array of country names that are to be highlighted. The country names must match those used in the SOVEREIGNT property of the boundaryEuropeGjson asset. Only useful if the hightlightAllEurope option is set to false.
fillEurope string Specifies the fill colour to use for the countries considered to be part of 'Europe' for the purposes of the visualisation. Can use any recognised JS way to specify a colour. (Default - black.)
strokeEurope string Specifies the stroke colour to use for the countries considered to be part of 'Europe' for the purposes of the visualisation. Can use any recognised JS way to specify a colour. (Default - rgb(100,100,100).)
fillWord string Specifies the fill colour to use for countries not considered to be part of 'Europe' for the purposes of the visualisation. Can use any recognised JS way to specify a colour. (Default - rgb(50,50,50).)
fillOcean string Specifies the fill colour to use for Ocean. Can use any recognised JS way to specify a colour. (Default - rgb(100,100,100).)
fillDot string Specifies the fill colour to use for map dots. Can use any recognised JS way to specify a colour. (Default - red.)
dotSize1 string Specifies a size multiplier for dot1. The base dotsize corresponds to a 30km radius on the ground. For the 'traces' map, dot1 represents records found in the current week. (Default - 1.)
dotSize2 string Specifies a size multiplier for dot2. The base dotsize corresponds to a 30km radius on the ground. For the 'traces' map, dot2 represents records found in the previous week. (Default - 3.)
dotSize3 string Specifies a size multiplier for dot3. The base dotsize corresponds to a 30km radius on the ground. For the 'traces' map, dot3 represents records found in the week two weeks before current. (Default - 6.)
dotOpacity1 string Specifies an opacity for dot1. For the 'traces' map, dot1 represents records found in the current week. (Default - 1.)
dotOpacity2 string Specifies an opacity for dot2. For the 'traces' map, dot2 represents records found in the previous week. (Default - 0.4.)
dotOpacity3 string Specifies an opacity for dot3. For the 'traces' map, dot3 represents records found in the week two weeks before current. (Default - 0.1.)
showZoomControls boolean Indicates whether zoom controls are to be displayed on the map. (Default - true.)
aggregate boolean Indicates data locations are to be shifted to the centre of the nearest 30km grid square. (Default - true.)
Source:
Returns:
api - Returns an API for the map.
Type
module:eSvgMap~api

(inner) getWeekDates(week, year)

This function is exposed as a method on the API returned from the eSvgMap function. Returns the start and end dates for a particular week and year. Where no year is specified, a leap year is assumed.
Parameters:
Name Type Description
week number A number indicating the week of the year for which to get dates.
year number A number indicating the week for which to get dates.
Source:

(inner) loadData(data)

This function is exposed as a method on the API returned from the eSvgMap function. This method is called to load fresh data. Doesn't itself display any data.
Parameters:
Name Type Description
data Array.<object> An array of data objects which should have the format: {year, week, lat, lon}.
Source:

(inner) mapData(week, year)

This function is exposed as a method on the API returned from the eSvgMap function. Display the data for a given year/week. If no year is specified, then data from all years are included.
Parameters:
Name Type Description
week number A number indicating the week of the year for which to display data.
year number A number indicating the year for which to display data can be blank to include all years.
Source:

(inner) resize(width, height)

This function is exposed as a method on the API returned from the eSvgMap function. Resize the map.
Parameters:
Name Type Description
width number A number indicating the width of the map in pixels.
height number A number indicating the height of the map in pixels.
Source:

(inner) setDisplayOpts(opts)

This function is exposed as a method on the API returned from the eSvgMap function. Set display options for the map.
Parameters:
Name Type Description
opts Object Initialisation options. The options are the color and dot size/opacity options.
Source:

(inner) showBusy(show)

This function is exposed as a method on the API returned from the eSvgMap function. Allows calling application to display/hide an indicator showing the map data is loading.
Parameters:
Name Type Description
show boolean A boolean value to indicate whether or not to show map data loading.
Source:

Type Definitions

api

Type:
  • Object
Properties:
Name Type Description
loadData module:eSvgMap~loadData Set the data to use for the map.
mapData module:eSvgMap~mapData Display a subset of the data.
getWeekDates module:eSvgMap~getWeekDates For a given weeka and year, return the start and end dates.
resize module:eSvgMap~resize Resize the map to the specified size.
setDisplayOpts module:eSvgMap~setDisplayOpts Set the display options for the map.
showBusy module:eSvgMap~showBusy Set a boolean value to indicate whether or not to show map data loading.
Source: