DataLoaderGui Class
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
Item Index
Methods
- choiceTreeCallbacks.fileTypeStepGuess
- choiceTreeCallbacks.serviceTypeStepGuess
- choiceTreeCallbacks.simpleAdvance
- choiceTreeCallbacks.simpleCancel
- closeChoiceTree
- createChoiceTree
- delayLoadingState
- guessLatLong
- handleFailure
- init static
- makeIconTemplate
- prepareChoiceTreeStructure
- setCurrentStep
- setStepState
Properties
Methods
choiceTreeCallbacks.fileTypeStepGuess
-
step
-
data
A callback to guess the file type from the file url or file object provided in step data.
Parameters:
-
step
StepItemstep item to guess file type on
-
data
typedata from the callback function
choiceTreeCallbacks.serviceTypeStepGuess
-
step
-
data
A callback to guess the service type from the service url provided in step data.
Parameters:
-
step
StepItemstep item to guess service type on
-
data
typedata from the callback function
choiceTreeCallbacks.simpleAdvance
-
step
-
data
-
targetChildData
A callback that advances the choice tree to the specified child step of the supplied step item.
choiceTreeCallbacks.simpleCancel
-
step
-
data
A callback that retreats part of the choice tree to the step item specified.
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
Delay setting loading state to the step for a specified time in case it happens really fast and it will flicker.
Returns:
setTimeout handle
guessLatLong
-
rows
From provided CSV data, guesses which columns are long and lat.
Parameters:
-
rows
Arraycsv data
Returns:
an object with lat and long string properties indicating corresponding field names
handleFailure
-
step
-
handle
-
brickNotices
Handles any failure happening in the choice tree by setting the responsible step to error and displaying appropriate notices.
init
()
static
Initialize add-dataset functionality and creates a add-dataset choice tree.
makeIconTemplate
-
templateName
-
hex
Creates a icon base64 template to be displayed in the layer selector.
Parameters:
Returns:
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
Notifies all step items in the tree which step is current at the moment.
Parameters:
-
event
Stringa StepItem.CURRENT_STEP_CHANGE event