terriajs
Version:
Geospatial data visualization platform.
3,551 lines (866 loc) • 59.4 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: RegionProvider</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: RegionProvider</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>RegionProvider<span class="signature">(regionType, properties<span class="signature-attributes">opt</span>, corsProxy)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="RegionProvider"><span class="type-signature"></span>new RegionProvider<span class="signature">(regionType, properties<span class="signature-attributes">opt</span>, corsProxy)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Instantiate a region provider by giving it an entry from the region mapping JSON file.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>regionType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Unique text identifier.</p></td>
</tr>
<tr>
<td class="name"><code>properties</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>Properties as given in configuration file.</p></td>
</tr>
<tr>
<td class="name"><code>corsProxy</code></td>
<td class="type">
<span class="param-type"><a href="CorsProxy.html">CorsProxy</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>an instance of CorsProxy for making ajax calls.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="_idIndex"><span class="type-signature"></span>_idIndex<span class="type-signature"> :Object</span></h4>
<div class="description">
<p>Look-up table of attributes, for speed.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line192">line 192</a>
</li></ul></dd>
</dl>
<h4 class="name" id="aliases"><span class="type-signature"></span>aliases<span class="type-signature"> :Array.<String></span></h4>
<div class="description">
<p>List of aliases which will be matched against if found as column headings.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<String></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h4 class="name" id="analyticsWmsLayerName"><span class="type-signature"></span>analyticsWmsLayerName<span class="type-signature"> :String</span></h4>
<div class="description">
<p>Name of the layer on the WMS server. Needed if the layer is a MVT layer, but the layer is also used for analytics region picker (analytics section uses WMS/WFS)</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line91">line 91</a>
</li></ul></dd>
</dl>
<h4 class="name" id="analyticsWmsServer"><span class="type-signature"></span>analyticsWmsServer<span class="type-signature"> :String</span></h4>
<div class="description">
<p>URL of WMS server. Needed if the layer is a MVT layer, but the layer is also used for analytics region picker (analytics section uses WMS/WFS)</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line85">line 85</a>
</li></ul></dd>
</dl>
<h4 class="name" id="bbox"><span class="type-signature"></span>bbox<span class="type-signature"> :Array.<Number>|undefined</span></h4>
<div class="description">
<p>Bounding box of vector geometry [w,s,e,n] (only defined for MVT providers)</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<Number></span>
|
<span class="param-type">undefined</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h4 class="name" id="dataReplacements"><span class="type-signature"></span>dataReplacements<span class="type-signature"> :Array.<Array></span></h4>
<div class="description">
<p>Array of [regex, replacement] arrays which will be applied to each user-provided ID element before matching
is attempted. For example, [ [ ' (.)$' ], '' ] will convert 'Baw Baw (S)' to 'Baw Baw'</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<Array></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line144">line 144</a>
</li></ul></dd>
</dl>
<h4 class="name" id="description"><span class="type-signature"></span>description<span class="type-signature"> :String</span></h4>
<div class="description">
<p>A text description of this region type, which may feature in the user interface.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line61">line 61</a>
</li></ul></dd>
</dl>
<h4 class="name" id="disambigProp"><span class="type-signature"></span>disambigProp<span class="type-signature"></span></h4>
<div class="description">
<p>The property within the same WFS region that can be used for disambiguation.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line152">line 152</a>
</li></ul></dd>
</dl>
<h4 class="name" id="layerName"><span class="type-signature"></span>layerName<span class="type-signature"> :String</span></h4>
<div class="description">
<p>Name of the WMS or MVT layer where these regions are found.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line67">line 67</a>
</li></ul></dd>
</dl>
<h4 class="name" id="nameProp"><span class="type-signature"></span>nameProp<span class="type-signature"> :String</span></h4>
<div class="description">
<p>WMS attribute whose value can be used as a user-facing name for the region. If this property is undefined, the regions
do not have names.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line56">line 56</a>
</li></ul></dd>
</dl>
<h4 class="name" id="nameProp"><span class="type-signature"></span>nameProp<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Returns the name of a field which is used to name the region in feature info.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line166">line 166</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regionDisambigIdsFile"><span class="type-signature"></span>regionDisambigIdsFile<span class="type-signature"> :String</span></h4>
<div class="description">
<p>JSON file for disambiguation attribute, as per regionIdsFile.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line206">line 206</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regionIdsFile"><span class="type-signature"></span>regionIdsFile<span class="type-signature"> :String</span></h4>
<div class="description">
<p>The URL of a pre-generated JSON file containing just a long list of IDs for a given
layer attribute, in the order of ascending feature IDs (fids). If defined, it will
be used in preference to requesting those attributes from the WFS server.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line200">line 200</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regionNames"><span class="type-signature"></span>regionNames<span class="type-signature"> :Array.<String></span></h4>
<div class="description">
<p>Array of names of each region, once retrieved from the server. Each item in <a href="RegionProvider.html#regions">RegionProvider#regions</a> has a corresponding
item in this array at the same index. To populate this array, call <a href="RegionProvider.html#loadRegionNames">RegionProvider#loadRegionNames</a>.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<String></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line186">line 186</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regionProp"><span class="type-signature"></span>regionProp<span class="type-signature"> :String</span></h4>
<div class="description">
<p>WMS attribute whose value will correspond to each region's code.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line50">line 50</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regions"><span class="type-signature"></span>regions<span class="type-signature"> :Array.<Object></span></h4>
<div class="description">
<p>Array of attributes of each region, once retrieved from the server.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<Object></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line179">line 179</a>
</li></ul></dd>
</dl>
<h4 class="name" id="regionType"><span class="type-signature"></span>regionType<span class="type-signature"> :String</span></h4>
<div class="description">
<p>String uniquely identifying this type of region (eg, 'sa4')</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line44">line 44</a>
</li></ul></dd>
</dl>
<h4 class="name" id="server"><span class="type-signature"></span>server<span class="type-signature"> :String</span></h4>
<div class="description">
<p>URL of the WMS or MVT server</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line73">line 73</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverMaxNativeZoom"><span class="type-signature"></span>serverMaxNativeZoom<span class="type-signature"> :Number</span></h4>
<div class="description">
<p>Maximum zoom which the server serves tiles at</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line115">line 115</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverMaxZoom"><span class="type-signature"></span>serverMaxZoom<span class="type-signature"> :Number</span></h4>
<div class="description">
<p>Maximum zoom which the maximum native zoom tiles can be rendered at</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line109">line 109</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverMinZoom"><span class="type-signature"></span>serverMinZoom<span class="type-signature"> :Number</span></h4>
<div class="description">
<p>Minimum zoom which the server serves tiles at</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverReplacements"><span class="type-signature"></span>serverReplacements<span class="type-signature"> :Array.<Array></span></h4>
<div class="description">
<p>Array of [regex, replacement] arrays which will be applied to each ID element on the server side before matching
is attempted. For example, [ [ ' (.)$' ], '' ] will convert 'Baw Baw (S)' to 'Baw Baw'</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<Array></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line134">line 134</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverSubdomains"><span class="type-signature"></span>serverSubdomains<span class="type-signature"> :Array.<String>|undefined</span></h4>
<div class="description">
<p>List of subdomains for requests to be sent to (only defined for MVT providers)</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<String></span>
|
<span class="param-type">undefined</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serverType"><span class="type-signature"></span>serverType<span class="type-signature"> :String</span></h4>
<div class="description">
<p>Server type (either 'WMS' or 'MVT')</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">String</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line79">line 79</a>
</li></ul></dd>
</dl>
<h4 class="name" id="textCode"><span class="type-signature"></span>textCode<span class="type-signature"> :Boolean</span></h4>
<div class="description">
<p>Whether this region type uses text codes, rather than numeric. It matters because numeric codes are treated differently by the
CSV handling models.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line173">line 173</a>
</li></ul></dd>
</dl>
<h4 class="name" id="uniqueIdProp"><span class="type-signature"></span>uniqueIdProp<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Returns the name of a field which uniquely identifies each region. This field is not necessarily used for matching, or
of interest to the user, but is needed for reverse lookups. This field must count from zero, and features must be
returned in sorted order.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line160">line 160</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="findDisambigVariable"><span class="type-signature"></span>findDisambigVariable<span class="signature">(varNames)</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
<p>If a disambiguation column is known for this provider, return a column matching its description.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>varNames</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Array of variable names.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line459">line 459</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The name of the first column that matches any of the given disambiguation aliases.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="findRegionVariable"><span class="type-signature"></span>findRegionVariable<span class="signature">(varNames)</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
<p>Returns the region variable of the given name, matching against the aliases provided.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>varNames</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Array of variable names.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line449">line 449</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The name of the first column that matches any of the given aliases.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="getColorLookupFunc"><span class="type-signature"></span>getColorLookupFunc<span class="signature">(regionValues, colorFunction)</span><span class="type-signature"> → {function}</span></h4>
<div class="description">
<p>Pre-generates a function which quickly turns a value into a colour.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>regionValues</code></td>
<td class="type">
<span class="param-type">Array.<Number></span>
</td>
<td class="description last"><p>Array of values, the same length as this.regions, giving a value to each region.</p></td>
</tr>
<tr>
<td class="name"><code>colorFunction</code></td>
<td class="type">
<span class="param-type"><a href="RegionProvider.html#~colorFunction">RegionProvider~colorFunction</a></span>
</td>
<td class="description last"><p>A function which maps region values to color arrays.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line429">line 429</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Function of type f(regionIndex) { return [r,g,b,a]; } which may return undefined.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">function</span>
</dd>
</dl>
<h4 class="name" id="getRegionFeature"><span class="type-signature"></span>getRegionFeature<span class="signature">(region, possibleFeature)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
<p>Gets the feature associated with a given region.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>region</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The region.</p></td>
</tr>
<tr>
<td class="name"><code>possibleFeature</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A feature that possibly corresponds to the region. If it does, it will be returned.
Otherwise, the matching feature will be requested from the region mapping server.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line473">line 473</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A promise for the feature.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="loadRegionIDs"><span class="type-signature"></span>loadRegionIDs<span class="signature">()</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
<p>Given an entry from the region mapping config, load the IDs that correspond to it, and possibly to disambiguation properties.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line238">line 238</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Promise with no return value.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="loadRegionNames"><span class="type-signature"></span>loadRegionNames<span class="signature">()</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
<p>Load names of regions. Used for analytics region picker.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line282">line 282</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Promise resolving to region names</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="mapRegionsToIndicesInto"><span class="type-signature"></span>mapRegionsToIndicesInto<span class="signature">(regionArray, disambigValues<span class="signature-attributes">opt</span>, failedMatches<span class="signature-attributes">opt</span>, ambiguousMatches<span class="signature-attributes">opt</span>, timeIntervals<span class="signature-attributes">opt</span>, time<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></h4>
<div class="description">
<p>Maps this.regions to indices into the provided regionArray.
Eg. If regionArray = ['Vic', 'Qld', 'NSW'], and this.regions = ['NSW', 'Vic', 'Qld', 'WA'], then returns [2, 0, 1, undefined].</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>regionArray</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>An array of the regions (eg. the column of State values from a csv file). Could be Strings or Numbers.</p></td>
</tr>
<tr>
<td class="name"><code>disambigValues</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>An array of disambiguating names/numbers for when regions alone are insufficient. Could be Strings or Numbers.</p></td>
</tr>
<tr>
<td class="name"><code>failedMatches</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>An optional empty array. If provided, indices of failed matches are appended to the array.</p></td>
</tr>
<tr>
<td class="name"><code>ambiguousMatches</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>An optional empty array. If provided, indices of matches which duplicate prior matches are appended to the array.
(Eg. these are not relevant if at different times.)</p></td>
</tr>
<tr>
<td class="name"><code>timeIntervals</code></td>
<td class="type">
<span class="param-type">Array.<TimeInterval></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>The time intervals during which each value in <code>regionArray</code> applies. If undefined, the data is not
time-varying.</p></td>
</tr>
<tr>
<td class="name"><code>time</code></td>
<td class="type">
<span class="param-type">JulianDate</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>The time at which to do the mapping. If undefined, the data is not time-varying.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line349">line 349</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Indices into this.region.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="~colorFunction"><span class="type-signature"></span>colorFunction<span class="signature">(value)</span><span class="type-signature"> → {Array.<Number>}</span></h4>
<div class="description">
<p>Function which maps region values to color arrays.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>The value for this region.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Map_RegionProvider.js.html">Map/RegionProvider.js</a>, <a href="Map_RegionProvider.js.html#line436">line 436</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a colorArray in the form [r, g, b, a].</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<Number></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AbsCode.html">AbsCode</a></li><li><a href="AbsConcept.html">AbsConcept</a></li><li><a href="AbsDataset.html">AbsDataset</a></li><li><a href="AbsIttCatalogGroup.html">AbsIttCatalogGroup</a></li><li><a href="AbsIttCatalogItem.html">AbsIttCatalogItem</a></li><li><a href="AddressGeocoder.html">AddressGeocoder</a></li><li><a href="ArcGisCatalogGroup.html">ArcGisCatalogGroup</a></li><li><a href="ArcGisFeatureServerCatalogGroup.html">ArcGisFeatureServerCatalogGroup</a></li><li><a href="ArcGisFeatureServerCatalogItem.html">ArcGisFeatureServerCatalogItem</a></li><li><a href="ArcGisMapServerCatalogGroup.html">ArcGisMapServerCatalogGroup</a></li><li><a href="ArcGisMapServerCatalogItem.html">ArcGisMapServerCatalogItem</a></li><li><a href="AugmentedVirtuality.html">AugmentedVirtuality</a></li><li><a href="BingMapsCatalogItem.html">BingMapsCatalogItem</a></li><li><a href="BooleanParameter.html">BooleanParameter</a></li><li><a href="BulkAddressGeocoderResult.html">BulkAddressGeocoderResult</a></li><li><a href="CameraView.html">CameraView</a></li><li><a href="Catalog.html">Catalog</a></li><li><a href="CatalogFunction.html">CatalogFunction</a></li><li><a href="CatalogGroup.html">CatalogGroup</a></li><li><a href="CatalogItem.html">CatalogItem</a></li><li><a href="CatalogMember.html">CatalogMember</a></li><li><a href="Cesium.html">Cesium</a></li><li><a href="Cesium3DTilesCatalogItem.html">Cesium3DTilesCatalogItem</a></li><li><a href="CesiumDragPoints.html">CesiumDragPoints</a></li><li><a href="CesiumTerrainCatalogItem.html">CesiumTerrainCatalogItem</a></li><li><a href="CkanCatalogGroup.html">CkanCatalogGroup</a></li><li><a href="CkanCatalogItem.html">CkanCatalogItem</a></li><li><a href="Clock.html">Clock</a></li><li><a href="CompositeCatalogItem.html">CompositeCatalogItem</a></li><li><a href="Concept.html">Concept</a></li><li><a href="CorsProxy.html">CorsProxy</a></li><li><a href="CsvCatalogItem.html">CsvCatalogItem</a></li><li><a href="CswCatalogGroup.html">CswCatalogGroup</a></li><li><a href="CustomComponentType.html">CustomComponentType</a></li><li><a href="CzmlCatalogItem.html">CzmlCatalogItem</a></li><li><a href="DataSourceCatalogItem.html">DataSourceCatalogItem</a></li><li><a href="DateTimeParameter.html">DateTimeParameter</a></li><li><a href="DisplayVariablesConcept.html">DisplayVariablesConcept</a></li><li><a href="EnumerationParameter.html">EnumerationParameter</a></li><li><a href="Feature.html">Feature</a></li><li><a href="FunctionParameter.html">FunctionParameter</a></li><li><a href="GeoJsonCatalogItem.html">GeoJsonCatalogItem</a></li><li><a href="GlobeOrMap.html">GlobeOrMap</a></li><li><a href="GnafAddressGeocoder.html">GnafAddressGeocoder</a></li><li><a href="GnafApi.html">GnafApi</a></li><li><a href="GnafSearchProviderViewModel.html">GnafSearchProviderViewModel</a></li><li><a href="GpxCatalogItem.html">GpxCatalogItem</a></li><li><a href="HelpScreen.html">HelpScreen</a></li><li><a href="HelpSequence.html">HelpSequence</a></li><li><a href="HelpSequences.html">HelpSequences</a></li><li><a href="HelpViewState.html">HelpViewState</a></li><li><a href="ImageryLayerCatalogItem____.html">ImageryLayerCatalogItem</a></li><li><a href="IonImageryCatalogItem.html">IonImageryCatalogItem</a></li><li><a href="KmlCatalogItem.html">KmlCatalogItem</a></li><li><a href="Leaflet.html">Leaflet</a></li><li><a href="LeafletDataSourceDisplay.html">LeafletDataSourceDisplay</a></li><li><a href="LeafletDragPoints.html">LeafletDragPoints</a></li><li><a href="LeafletGeomVisualizer.html">LeafletGeomVisualizer</a></li><li><a href="LegendHelper.html">LegendHelper</a></li><li><a href="LegendUrl.html">LegendUrl</a></li><li><a href="LineParameter.html">LineParameter</a></li><li><a href="MagdaCatalogItem.html">MagdaCatalogItem</a></li><li><a href="MapboxMapCatalogItem.html">MapboxMapCatalogItem</a></li><li><a href="MapInteractionMode.html">MapInteractionMode</a></li><li><a href="Metadata.html">Metadata</a></li><li><a href="MetadataItem.html">MetadataItem</a></li><li><a href="module.html#.exports">exports</a></li><li><a href="OgrCatalogItem.html">OgrCatalogItem</a></li><li><a href="OpenStreetMapCatalogItem.html">OpenStreetMapCatalogItem</a></li><li><a href="PlacesLikeMeCatalogfunction.html">PlacesLikeMeCatalogfunction</a></li><li><a href="PointParameter.html">PointParameter</a></li><li><a href="Polling.html">Polling</a></li><li><a href="PolygonParameter.html">PolygonParameter</a></li><li><a href="RectangleParameter.html">RectangleParameter</a></li><li><a href="RegionDataParameter.html">RegionDataParameter</a></li><li><a href="RegionMapping.html">RegionMapping</a></li><li><a href="RegionParameter.html">RegionParameter</a></li><li><a href="RegionProvider.html">RegionProvider</a></li><li><a href="RegionProviderList.html">RegionProviderList</a></li><li><a href="RegionTypeParameter.html">RegionTypeParameter</a></li><li><a href="ResultPendingCatalogItem.html">ResultPendingCatalogItem</a></li><li><a href="SdmxJsonCatalogItem.html">SdmxJsonCatalogItem</a></li><li><a href="SensorObservationServiceCatalogItem.html">SensorObservationServiceCatalogItem</a></li><li><a href="SocrataCatalogGroup.html">SocrataCatalogGroup</a></li><li><a href="SpatialDetailingCatalogFunction.html">SpatialDetailingCatalogFunction</a></li><li><a href="StringParameter.html">StringParameter</a></li><li><a href="SummaryConcept.html">SummaryConcept</a></li><li><a href="TableCatalogItem.html">TableCatalogItem</a></li><li><a href="TableColumn.html">TableColumn</a></li><li><a href="TableColumnStyle.html">TableColumnStyle</a></li><li><a href="TableDataSource.html">TableDataSource</a></li><li><a href="TableStructure.html">TableStructure</a></li><li><a href="TableStyle.html">TableStyle</a></li><li><a href="TerrainCatalogItem.html">TerrainCatalogItem</a></li><li><a href="Terria.html">Terria</a></li><li><a href="TerriaError.html">TerriaError</a></li><li><a href="TerriaJsonCatalogFunction.html">TerriaJsonCatalogFunction</a></li><li><a href="TimeSeriesStack.html">TimeSeriesStack</a></li><li><a href="UrlTemplateCatalogItem.html">UrlTemplateCatalogItem</a></li><li><a href="UrthecastCatalogGroup.html">UrthecastCatalogGroup</a></li><li><a href="UrthecastServerCatalogItem.html">UrthecastServerCatalogItem</a></li><li><a href="UserDrawing.html">UserDrawing</a></li><li><a href="VariableConcept.html">VariableConcept</a></li><li><a href="ViewerModes..html">ViewerModes.</a></li><li><a href="WebFeatureServiceCatalogGroup.html">WebFeatureServiceCatalogGroup</a></li><li><a href="WebFeatureServiceCatalogItem.html">WebFeatureServiceCatalogItem</a></li><li><a href="WebMapServiceCatalogGroup.html">WebMapServiceCatalogGroup</a></li><li><a href="WebMapServiceCatalogItem.html">WebMapServiceCatalogItem</a></li><li><a href="WebMapTileServiceCatalogGroup.html">WebMapTileServiceCatalogGroup</a></li><li><a href="WebMapTileServiceCatalogItem.html">WebMapTileServiceCatalogItem</a></li><li><a href="WebProcessingServiceCatalogFunction.html">WebProcessingServiceCatalogFunction</a></li><li><a href="WebProcessingServiceCatalogGroup.html">WebProcessingServiceCatalogGroup</a></li><li><a href="WebProcessingServiceCatalogItem.html">WebProcessingServiceCatalogItem</a></li><li><a href="WfsFeaturesCatalogGroup.html">WfsFeaturesCatalogGroup</a></li><li><a href="WhyAmISpecialCatalogFunction.html">WhyAmISpecialCatalogFunction</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_bumpyTerrainProvider">_bumpyTerrainProvider</a></li><li><a href="global.html#_terrain">_terrain</a></li><li><a href="global.html#activeTimeColumnNameIdOrIndex">activeTimeColumnNameIdOrIndex</a></li><li><a href="global.html#addBoundingBox">addBoundingBox</a></li><li><a href="global.html#addMarker">addMarker</a></li><li><a href="global.html#addUserCatalogMember">addUserCatalogMember</a></li><li><a href="global.html#allFeaturesAvailablePromise">allFeaturesAvailablePromise</a></li><li><a href="glob