Class: AssetCategory

AssetCategory()

A AssetCategory Model contains metadata about the category, like a label and an icon.

Constructor

new AssetCategory()

Since:
  • 2.28.0
Source:

Extends

  • Backbone.Model

Members

defaults :object

Default attributes for AssetCategory models
Type:
  • object
Properties:
Name Type Attributes Default Description
label string A user friendly name for this category, to be displayed in a map.
icon string A PID for an SVG saved as a dataObject, or an SVG string. The SVG will be used as an icon that will be displayed next to the category label. It should be an SVG file that has no fills, borders, or styles set on it (since the icon will be shaded dynamically by the maps CSS using a fill attribute). It must use a viewbox property rather than a height and width.
expanded boolean <optional>
false Set to true when this category has been expanded by the user.
mapAssets MapAssets The data to render in the map.
Source:

type :string

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

Methods

initialize(categoryConfig)

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

setMapModel(mapModel)

Set the parent map model on each of the MapAsset models in this collection. This must be the Map model that contains this asset collection.
Parameters:
Name Type Description
mapModel MapModel The map model to set on each of the AssetCategory models
Source:

updateIcon(icon)

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