Module: app/DataController

Data controller module
Author:
Source:

Methods

(private, inner) _getStarted(fs)

Converts initial query task results of tide stations and lidar coverage areas into dstore memory stores
Parameters:
Name Type Description
fs obj feature set results from query task
Source:

(private, inner) _getStationsIds()

Json request to get the list of tide stations
Source:

(private, inner) _init()

Private method that initializes the module by querying for the lidar coverage areas and tide stations. Waits both queries to complete before continuing.
Source:

(private, inner) _prepData(fs)

Processes feature set from query task of storm surge and tide data for a particular tide station. Creates/overwrites a dstore memory stores used with the tide and storm surge chart.
Parameters:
Name Type Description
fs obj feature set results from query task
Source:

(private, inner) _query(urlQ, outFieldsQ, orderByQ, geoQ, whereQ)

Executes QueryTask https://developers.arcgis.com/javascript/3/jsapi/querytask-amd.html Need to use on("complete") and/or on("error") to get access to the response
Parameters:
Name Type Description
urlQ string URL of rest end point to be queried
outFieldsQ array An optional array of fields to be returned (defaults to ["*"])
orderByQ array An optional array of fields to order the results by (defaults to "")
geoQ boolean Optional return geometry (defaults to false)
whereQ string Optional where clause for a query (defaults to "1=1")
Source:

(inner) getTideData(dataURL)

Queries url for tide and storm surge data for a particular tide station. Passes results to _prepData method to format data into a dstore memory store
Parameters:
Name Type Description
dataURL string URL of rest end point to be queried
Source:

(inner) mapStnIds(query)

Swaps keys and values of tide station
Parameters:
Name Type Description
query obj task results
Source:

(inner) startup()

Starts the module
Source:

(inner) toTitleCase(str)

Converts strings to title case. Modified from http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript
Parameters:
Name Type Description
str string The text to be converted to titleCase.
Source: