Class: ZoomPresetCategory

ZoomPresetCategory()

A ZoomPresetCategory Model contains metadata about the group of preset locations in a Map, including a label, optional icon, and whether the category is expanded by default in the Viewfinder UI.

Constructor

new ZoomPresetCategory()

Since:
  • 2.35.0
Source:

Extends

  • Backbone.Model
  • Backbone.Model

Members

type :string

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

Methods

defaults() → {object}

Default attributes for ZoomPresetCategory models. See the MapConfig#ZoomPresetCategory 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 ZoomPresetCategory model is created.
Parameters:
Name Type Description
attrs MapConfig#ZoomPresetCategory The initial values of the attributes, which will be set on the model.
Source:

setMapModel(mapModel)

Set the parent map model on the ZoomPresets 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 ZoomPresets 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 ZoomPresetCategory icon
Source: