Q4Widgets API Documentation

q4.multiMap

An interactive map with multiple datasets, that you can toggle between.
Script link
q4.multimap.1.0.0.min.js
Source file
q4.multimap.js, line 2
Requires

Options

map string
The name of the map to use from jVectorMap. The corresponding JS file must be included.
Default value
us_lcc_en
backgroundColour string
The background colour of the map.
Default value
transparent
defaultColour string
The colour of map elements that aren't in any category.
Default value
#ffffff
elementPrefix string
An optional prefix to add to all element codes.
views Array.<Object>
An array of views. Each view is made up of geographic elements (e.g. countries or states), which are grouped into categories. Each category has a colour, and an entry in that view's legend. View objects have these properties: - `label` The name of the view. - `cssClass` An optional class to add to the trigger. - `legend` Whether to display a legend. Defaults to true. - `text` Some optional text to display. - `categories` An array of category objects with these properties: - `label` The name of the category. - `colour` The CSS colour to use for elements in this category. - `elements` An array of map elements that are in this category. - `cssClass` An optional class to add to the legend item.
viewContainer string
A selector for the container for view triggers.
Default value
.views
viewTrigger string
A selector for each view trigger in the view container.
Default value
> li
viewTemplate string
A template for a single view trigger, corresponding to the `viewTrigger` selector. All the properties of the view in the `views` array are available as tags.
Default value
<li class="{{cssClass}}"><span></span>{{label}}</li>
legendContainer string
A selector for the container for legend categories.
Default value
.legend
legendTemplate string
A template for a single legend category, corresponding to the `legendContainer` selector.. All the properties of the category in the `views` array are available as tags.
Default value
<li class="{{cssClass}}"><span style="background-color: {{colour}}"></span>{{label}}</li>
textContainer string
A selector for the container for category text.
Default value
.text
mapContainer string
A selector for the vector map.
Default value
#map
template string
An overall template for the widget. This should contain elements corresponding to `viewContainer`, `legendContainer`, `textContainer` and `mapContainer`.