Reusable Accessible Mapping Platform

API Docs for: 5.2.0
Show:

DataLoaderGui Class

Uses
Module: FilterManager
Parent Module: RAMP

Creates a choice tree for adding datasets.

Imports RAMP Modules:

PopupManager
DataLoader
Theme
Map
LayerLoader
GlobalStorage
StepItem
Util
TmplHelper
TmplUtil
Array
Dictionary
Bricks

Uses RAMP Templates:

templates/filter_manager_template.json

Methods

choiceTreeCallbacks.fileTypeStepGuess

(
  • step
  • data
)
private

A callback to guess the file type from the file url or file object provided in step data.

Parameters:

  • step StepItem

    step item to guess file type on

  • data type

    data from the callback function

choiceTreeCallbacks.serviceTypeStepGuess

(
  • step
  • data
)
private

A callback to guess the service type from the service url provided in step data.

Parameters:

  • step StepItem

    step item to guess service type on

  • data type

    data from the callback function

choiceTreeCallbacks.simpleAdvance

(
  • step
  • data
  • targetChildData
)
private

A callback that advances the choice tree to the specified child step of the supplied step item.

Parameters:

  • step StepItem

    step item to advance from

  • data Object

    data from the choice brick in step item

  • targetChildData Object

    data to be passed to the step being advanced to

choiceTreeCallbacks.simpleCancel

(
  • step
  • data
)
private

A callback that retreats part of the choice tree to the step item specified.

Parameters:

  • step StepItem

    step item to retreat to

  • data Object

    data from the callback function

closeChoiceTree

() private

Closes the add dataset choice tree.

createChoiceTree

() private

Creates a new choice tree html representation and appends it to the page.

delayLoadingState

(
  • step
  • time
)
Number private

Delay setting loading state to the step for a specified time in case it happens really fast and it will flicker.

Parameters:

  • step StepItem

    step to delay setting loading state on

  • time Number

    a delay in ms

Returns:

Number:

setTimeout handle

guessLatLong

(
  • rows
)
Object private

From provided CSV data, guesses which columns are long and lat.

Parameters:

Returns:

Object:

an object with lat and long string properties indicating corresponding field names

handleFailure

(
  • step
  • handle
  • brickNotices
)
private

Handles any failure happening in the choice tree by setting the responsible step to error and displaying appropriate notices.

Parameters:

  • step StepItem

    a step item that should handle failure

  • handle Number

    a timeout handle to be canceled

  • brickNotices Object

    brick notices to be displayed

init

() static

Initialize add-dataset functionality and creates a add-dataset choice tree.

makeIconTemplate

(
  • templateName
  • hex
)
String private

Creates a icon base64 template to be displayed in the layer selector.

Parameters:

  • templateName String

    a name of the template to use for an icon

  • hex String

    color value in hex

Returns:

String:

a base64 encoded icon template

prepareChoiceTreeStructure

() private

Create choice tree structure. This function is executed as part of the module initialization so that i18n strings can be properly loaded

setCurrentStep

(
  • event
)
private

Notifies all step items in the tree which step is current at the moment.

Parameters:

  • event String

    a StepItem.CURRENT_STEP_CHANGE event

setStepState

(
  • event
  • step
  • state
)
private

Notifies all step items in the tree that a certain step has changed its state.

Parameters:

  • event Object

    a StepItem.STATE_CHANGE event

  • step StepItem

    a step item; this doesn't seem to be used

  • state String

    a state; this doesn't seem to be used

Properties

choiceTree

Object private

A choice tree config object

Config has a simple tree structure, with content being an array of Brick object to be placed inside a StepItem.

choiceTreeCallbacks

Object private

A collection of callbacks used by the choice tree.

choiceTreeErrors

Object private

A collection of precanned error messages that are used by the choice tree.