API Docs for: 0.0.8-0
Show:

FilterManager Class

FilterManager class. Represents the legend next to the map and the controls to toggle each map layer's visibility and boundary box. The FilterManager also includes a attribute filter that allows the user to hide map features based on a attribute values

For a doc with diagrams on how this class works, please see http://ecollab.ncr.int.ec.gc.ca/projects/science-apps/priv/RAMP/RAMP%20AMD%20Filter%20Module.docx

Item Index

Attributes

Methods

_getFeatures

(
  • fl
)
Object

Queries all map points on a given feature layer and returns their attributes

Parameters:

  • fl Object

    A feature layer to query

Returns:

Object:

An array of attributes from the designated feature layer

_getField

(
  • fl
  • The
)
Object

Grabs all distinct values of the given field from a featureLayer.

Parameters:

  • fl Object

    A feature layer to query

  • The String

    field (or column) to query in the feature layer

Returns:

Object:

deferred A deferred object which will resolve to an array of unique values

_getSymbolConfig

(
  • layerUrl
)
Esri/layer/symbology

Inherited from RAMP but overwritten in javascript\src\RAMP\Modules\ramp.js:96

Gets the defined symbology from a layer's web service

Parameters:

  • layerUrl String

    A URL to the feature layer service

Returns:

Esri/layer/symbology:

The defined symbology from the layer definition

adjustExpandAllButtonState

() private

Changes the state of the expand all control if all the nodes are expanded.

adjustHeight

() private

Adjust the height of the body of the page on initial load and every page resize.

adjustHelpDimensions

() private

Adjusts dimensions of the help panel relative to the mapContent div.

adjustPaneWidth

() private

Changes the width of the layers pane to accommodate for the scrollbar if it's needed.

adjustWidth

() private

Adjusts the width of the slide out panel and the map section.

adjutSubPanelDimensions

(
  • subPanel
)
private

Adjusts the dimensions and position of the SubPanel when layout of the page is changing.

Parameters:

  • subPanel SubPanel

    SubPanel whose dimensions and position need to be adjusted

captureSubPanel

(
  • attr
)
private

Finds a SubPanel with origin equal to the supplied consumeOrigin and

  • changes its origin to the supplied origin
  • moves the SubPanel in the DOM hierarchy and attaches it to the specified target

Parameters:

  • attr SubPanelSettings

    Settings for the SubPanel; only origin, consumeOrigin and target are required here

dockSubPanel

(
  • attr
)
private

Moves the SubPanel with the specified origin in the DOM hierarchy to the new specified target; if target is not specified, the SubPanel is attached to the SidePanel.

Parameters:

  • attr SubPanelSettings

    Settings for the SubPanel; only target and origin are required here

generateFilterCheckboxes

() String

Generates legend for each interactive layer on the map (non-basemap layers).

Returns:

String:

a string representation of the legends with simplified layer info for identification

generateGlobalCheckboxes

() Object

Generates a data grid row with a checkbox.

Returns:

Object:

toggleRow the generated data grid row.

getLayerConfig

(
  • url
)

Returns the feature layer config for the given url

Parameters:

getSymbolForFeature

(
  • feature
)
Icon

Given a feature object or a graphic object (or any object that has a getLayer method and an attributes field) return the object containing the image URL and legend text for that feature/graphic object.

Parameters:

Returns:

Icon:

The default icon used to represent the feature layer

hideSubPanel

(
  • attr
  • speed
  • d
)
private

Closes the SubPanel whose origin is specified in the attr parameter.

Parameters:

  • attr SubPanelSettings

    only origin attribute is required here

  • speed Number

    Duration of the closing animation

  • d Deferred

    The deferred object to be resolved upon successful closing of the panel

init

()

Reads the application configuration and creates the legend and filter management widget

initListeners

() private

Initiates a listener to handle tab deselected event

initScrollListeners

() private

Adjusts filter style according to the scroll action on the layers.

initTooltips

() private

initialize a tooltip for each layer, using the layer name.

layoutChange

() private

Fires an event when the layout of the page changes.

load

(
  • id
  • req
  • load
)

Call load to initialize the GUI module.

Parameters:

  • id Number

    ID of this module

  • req ?

    ???

  • load Function

    The callback function

loadStrings

()

Updates some of the Strings on the HTML page using the config string resources

newPopup

(
  • popupAttr
)
private

Create a new PopupBase object from the settings provided.

Parameters:

Returns:

popup

newSubPanel

(
  • attr
)
SubPanel private

Create a new SubPanel with the settings provided.

Parameters:

Returns:

SubPanel:

A newly created SubPanel

setButtonEvents

() private

Adjusts UI layout according to a layer event.

setCheckboxEvents

() private

Sets UI status of a layer presentation (checkbox and eye) according to the user action: select / de-select a layer. publishes event "filterManager/box-visibility-toggled" every time a layer status changed. There should only be one eye and one global checkbox, but we say checkbox"es" because jquery returns a list and it's easier to write a function that takes a list of checkboxes than to write two functions, one to take a list and one to take an individual checkbox

showSubPanel

(
  • attr
)
private

Creates and opens a new SubPanel with given settings. If the SubPanel with the requested origin is already present, updates its content.

Parameters:

subPanelChange

(
  • visible
  • origin
  • container
)
private

Fires an even when the subpanel closes or opens.

Parameters:

  • visible Boolean

    indicates whether the panel is visible or not

  • origin String

    origin of the subpanel

  • container JObject

    subpanel container

toggleBox

(
  • checked
  • node
)

Toggles the boundary box button beside a given layer in the legend. Fires the box_visibility event.

Parameters:

  • checked Boolean

    The check status of the boundary box button next to the target layer (on or off)

  • node Object

    The legend item representing the target layer

toggleEye

(
  • checked
  • node
)

Toggles the visibility button (or eye) beside a given layer in the legend. Fires the layer_visibility event.

Parameters:

  • checked Boolean

    The check status of the visibility button next to the target layer (on or off)

  • node Object

    The legend item representing the target layer

toggleFooter

() private

Animate the footer during full-screen transitions.

toggleFullScreenMode

(
  • fullscreen
)
private

Toggles the FullScreen mode of the application

Parameters:

  • fullscreen Boolean

    true/undefined - expand; false - collapse

toggleGlobalBox

(
  • checked
)

Toggles each layers boundary box display check box when the global boundary box button is clicked

Parameters:

  • checked Boolean

    The value of the global boundary box button's check status (on or off)

toggleGlobalEye

(
  • checked
)

Toggles each layers visibility when the global visibility button is clicked

Parameters:

  • checked Boolean

    The value of the global visibility button's check status (on or off)

toggleSubPanelContainer

() private

Adjust the SubPanels to the full-screen mode of the page.

Attributes

getConfigUrl

readonly

Returns a URL that points to the application configuration (JSON format) if it's hosted on a web service. This is not required if the application has a JSON config file in the website's folder

Events

FilterManager.events.BOX_VISIBILITY_TOGGLED

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:45

Published whenever the "box" button for a layer is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "box" button is checked, false otherwise

    • node Object

      the input dom node that represents the checkbox

FilterManager.events.GLOBAL_BOX_VISIBILITY_TOGGLED

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:56

Published whenever the global "box" button is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "box" button is checked, false otherwise

FilterManager.events.GLOBAL_LAYER_VISIBILITY_TOGGLED

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:24

Published whenever the global "eye" button is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "eye" button is checked, false otherwise

FilterManager.events.LAYER_VISIBILITY_TOGGLED

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:34

Published whenever the "eye" button for a layer is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "eye" button is checked, false otherwise

    • node Object

      the input dom node that represents the checkbox

FilterManager.events.SELECTION_CHANGED

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:66

Published whenever the layer list is rearranged

Event Payload:

  • event Object
    • id String

      the layer Id

    • index Integer

      index of the layer that moved. index is relative to the control, not the layer stack in the map

FilterManager.events.TOGGLE_BOX_VISIBILITY [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:98

Tells the filter manager to toggle a layer on or off

Event Payload:

  • event Object
    • layerName String

      the name of the layer to toggle

    • visible Boolean

      true if the layer should be visible, false otherwise

FilterManager.events.TOGGLE_GLOBAL_BOX_VISIBILITY [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:119

Tells the filter manager to toggle all bounding boxes on or off

Event Payload:

  • event Object
    • visible Boolean

      true if all the bounding boxes should be visible, false otherwise

FilterManager.events.TOGGLE_GLOBAL_LAYER_VISIBILITY [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:109

Tells the filter manager to toggle all layers on or off

Event Payload:

  • event Object
    • visible Boolean

      true if all the layers should be visible, false otherwise

FilterManager.events.TOGGLE_LAYER_VISIBILITY [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:87

Tells the filter manager to toggle a layer on or off

Event Payload:

  • event Object
    • layerName String

      the name of the layer to toggle

    • visible Boolean

      true if the layer should be visible, false otherwise

FilterManager.events.UI_COMPLETE

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:78

Published after the ui for the filter manager finishes initializing.

gui.events.FULLSCREEN_CHANGE

Published each time fullscreen is toggled

Event Payload:

  • evt Object

    the event Object

    • fullscreen Boolean

      true if fullscreen is on, false if fullscreen is off.

gui.events.HELP_PANEL_CHANGE

Published each time the help panel opens or closes.

Event Payload:

  • evt Object

    the event Object

  • visible Boolean

    true if the help panel is opened, false if the help panel is closed

gui.events.LAYOUT_CHANGE

Published each time the layout changes.

gui.events.PANEL_CHANGE

Published each time the panel opens/closes

Event Payload:

  • evt Object

    the event Object

    • visible Boolean

      true if the panel is opened, false otherwise

gui.events.PANEL_TOGGLE [subscribed]

Toggles the main panel (i.e. collapses it if was expanded, and expands it if it was collapsed)

gui.events.SUBPANEL_CAPTURE [subscribed]

Attaches subPanel node to the module that calls it in the DOM hierarchy

Event Payload:

gui.events.SUBPANEL_CHANGE

Published each time the subpanel opens/closes

Event Payload:

  • evt Object

    the event Object

    • visible Boolean

      true if the subpanel is opened, false otherwise

    • origin String
    • container JObject

      jQuery reference to the sub-panel container

gui.events.SUBPANEL_CLOSE [subscribed]

Closes the sub panel

Event Payload:

  • origin String

    the name of the module that requested to close the subPanel (e.g. "filterManager")

gui.events.SUBPANEL_DOCK [subscribed]

Moves the panel up DOM hierarchy next to the sidePanel, or to other target

Event Payload:

  • origin String

    the name of the module that requested to dock the subPanel (e.g. "filterManager")

  • target JNode

    where to move the subPanel; if not supplied; sidePanel is used

gui.events.SUBPANEL_OPEN [subscribed]

Opens the subpanel

Event Payload:

gui.events.TAB_DESELECTED

Fires whenever a tab has been deselected in the main panel

Event Payload:

  • evt Object

    the event Object

    • id String

      the id of the deselected tab

    • tabName String

      the name of the deselected tab

gui.events.TAB_SELECTED

Fires whenever a tab has been selected in the main panel

Event Payload:

  • evt Object

    the event Object

    • id String

      the id of the selected tab

    • tabName String

      the name of the selected tab

gui.events.TOGGLE_FULLSCREEN [subscribed]

Toggles the fullscreen

Event Payload:

  • evt Object

    the event Object

    • expand Boolean

      true if we should go into fullscreen mode, false if we wish to collapse to normal mode. If undefined, it toggles the fullscreen (i.e. make it fullscreen if it was not, make it collapse to regard mode if it was fullscreen).

gui/add-layer-panel-change

Published each time the Add Layer panel opens or closes.

Event Payload:

  • evt Object

    the event Object

  • visible Boolean

    true if the AddLayer panel is opened, false if the AddLayer panel is closed