Class: ViewfinderCardModel

ViewfinderCardModel()

ViewfinderCardModel represents a point of interest on a map that can be configured within a MapView. Each card requires a title, description, and at least one button action of type 'iframe', 'tab', or 'map'. This class was generalized from ZoomPresetModel and was renamed for clarity when zoom presets were deprecated in favor of more generalized viewfinder cards in 2.37.0, but the legacy zoom preset configuration format is still supported for backward compatibility. Top level latitude, longitude, height, and layerIds fields are synthesized into a 'map' action button with secondary ordinality, a "View Layers" label, and eye icon. Actions are only URL-restorable when they have an ID explicitly configured.

Constructor

new ViewfinderCardModel()

Since:
  • 2.29.0
Source:

Extends

  • Backbone.Model

Members

defaults :ViewfinderCardModelOptions

Type:
Source:

Methods

initialize()

Normalize configured action ids on construction so direct model instantiation and collection parsing both preserve explicit URL restore-state ids.
Since:
  • 2.38.0
Source:

parse(data) → {object}

Extended from ZoomPresetModel's Parse() when zoom presets were deprecated in favor of generalized viewfinder cards in 2.37.0. Parses incoming data to create a ViewfinderCardModel. Handles the legacy `position` field and synthesizes a 'map' button action (with secondary ordinality, "View Layers" label, and eye icon) from any top-level `latitude`/`longitude`/`height`/`layerIds` fields or from the legacy `position` object. The synthesized action is appended after any explicitly provided buttons.
Parameters:
Name Type Description
data object The raw data to parse.
Properties
Name Type Attributes Description
position object <optional>
Legacy {latitude, longitude, height}.
latitude number <optional>
Top-level latitude.
longitude number <optional>
Top-level longitude.
height number <optional>
Top-level camera altitude in metres.
layerIds Array.<string> <optional>
Top-level layer IDs.
buttons Array.<ViewfinderCardAction> <optional>
Explicit button actions.
Source:
Returns:
The parsed attributes.
Type
object