Class: ViewfinderCardCategory

ViewfinderCardCategory()

A ViewfinderCardCategory Model contains metadata about a group of viewfinder cards in a Map, including a label, optional icon, and whether the category is expanded by default in the Viewfinder UI. It was generalized from the ZoomPresetCategory model and renamed for clarity when zoom presets were deprecated in favor of viewfinder cards in 2.37.0.

Screenshot

Constructor

new ViewfinderCardCategory()

Since:
  • 2.35.0
Source:

Extends

  • Backbone.Model

Members

type :string

The name of this type of model
Type:
  • string
Source:

Methods

defaults() → {object}

Default attributes for ViewfinderCardCategory models. See the MapConfig#ViewfinderCardCategory typedef for details on each attribute. Also adds a mapModel attribute that is not part of the config, but is set when the model is created.
Source:
Returns:
The default attributes for the model.
Type
object

initialize(attrs)

Executed when a new ViewfinderCardCategory model is created.
Parameters:
Name Type Description
attrs MapConfig#ViewfinderCardCategory The initial values of the attributes, which will be set on the model.
Source:

setMapModel(mapModel)

Set the parent map model on the ViewfinderCards collection in this category. This must be the Map model that contains this category.
Parameters:
Name Type Description
mapModel MapModel The map model to set on the ViewfinderCards collection
Source:

updateIcon(icon)

Sanitizes an SVG string and updates the model's 'icon' attribute with the sanitized string.
Parameters:
Name Type Description
icon string An SVG string to use for the ViewfinderCardCategory icon
Source: