Class: ViewfinderCardCategories

ViewfinderCardCategories()

ViewfinderCardCategories is a collection of ViewfinderCardCategory models. Each category groups a ViewfinderCards collection used by the Viewfinder UI. This component was generalized from ZoomPresetsCollection and was renamed for clarity when the zoom presets were deprecated in favor of viewfinder cards in 2.37.0.

Constructor

new ViewfinderCardCategories()

Since:
  • 2.35.0
Source:

Extends

  • Backbone.Collection

Members

model

Source:

Methods

getViewfinderCards() → {Array.<ViewfinderCards>}

Get an array of ViewfinderCards, one per ViewfinderCardCategory.
Source:
Returns:
A list of ViewfinderCards collections.
Type
Array.<ViewfinderCards>

getViewfinderCardsFlat() → {ViewfinderCards}

Get a single flattened ViewfinderCards collection from all categories.
Source:
Returns:
A ViewfinderCards collection constructed from the combined models of each category's ViewfinderCards.
Type
ViewfinderCards

parse(resp, options) → {Array.<object>}

Parse raw category configs into attributes for ViewfinderCardCategory models. Ensures the Map model is available to each category.
Parameters:
Name Type Description
resp Array.<MapConfig#ViewfinderCardCategory> The raw array of category configs.
options object Options passed to the collection constructor.
Properties
Name Type Attributes Description
mapModel MapModel <optional>
The Map model for these cards.
Source:
Returns:
The parsed attributes for each model.
Type
Array.<object>

setMapModel(mapModel)

Set the parent Map model on each ViewfinderCardCategory in this collection.
Parameters:
Name Type Description
mapModel MapModel The Map model that contains these categories.
Source: