Class: LayerDownloadView

LayerDownloadView()

A component of DownloadPanelView. Renders an expandable row for a single downloadable map layer: a header with a checkbox and layer name, and a collapsible content area with resolution and file-format dropdowns and an informational label with instructions and an estimated file size. This view is tightly coupled to its parent by design — it reads `dropdownOptions` and `zoomLevels` from the parent to populate its dropdowns, and calls back into parent methods (`layerSelection`, `fileTypeSelection`, `getRawFileSize`, `updateTextbox`) to update panel-level state. It is not intended for use outside of `DownloadPanelView`. When the resolution selection is invalidated, this view triggers a `"download:invalidated"` event (with `layerID` as the argument) rather than mutating the parent's `dataDownloadLinks` directly. The parent is responsible for listening to that event and cleaning up its own state.

Screenshot

Constructor

new LayerDownloadView()

Since:
  • 2.37.0
Source:

Extends

  • Backbone.View

Members

className :string

The HTML classes to use for this view's element
Type:
  • string
Source:

template :Underscore.template

The primary HTML template for this view.
Type:
  • Underscore.template
Source:

type :string

The type of View this is
Type:
  • string
Source:

Methods

collapse()

Hide the content section without changing the checkbox state.
Source:

events()

Source:

expand()

Show the content section without changing the checkbox state.
Source:

handleCheckboxChange()

Handles changes to the layer checkbox. If checked, selects the layer and expands the content; if unchecked, deselects, collapses, and resets the dropdowns.
Source:

handleFileTypeChange()

Handles changes to the file-type dropdown. Calculates the estimated file size and updates the info box and save-button state.
Source:

handleResolutionChange()

Handles changes to the resolution dropdown. Enables the file-type dropdown, clears the file-type selection, removes stale download links, and updates the info box and save-button state.
Source:

initialize(options)

Initialise the view.
Parameters:
Name Type Description
options object Options for the view.
Properties
Name Type Description
item object The layer data object for this row.
downloadPanelView DownloadPanelView Reference to the parent view for shared logic (save-button state, file-size).
Source:

isExpanded() → {boolean}

Source:
Returns:
Whether the content section is currently visible.
Type
boolean

remove()

Source:

render() → {LayerDownloadView}

Render the complete panel: a header row with [checkbox] [title] and a collapsible content section with the download controls.
Source:
Returns:
this
Type
LayerDownloadView

resetDropdowns()

Reset both dropdowns to their default/disabled state and clear the file-size label.
Source: