Class: ZoomPresets

ZoomPresets()

A ZoomPresets collection is a group of ZoomPresetModel models that provide a location and list of layers to make visible when the user selects.

Constructor

new ZoomPresets()

Since:
  • 2.29.0
Source:

Extends

  • Backbone.Collection

Members

model

Source:

Methods

initialize(_models, optionsopt)

Constructor for the ZoomPresets collection.
Parameters:
Name Type Attributes Description
_models Array The initial set of models to be added to the collection.
options object <optional>
Options for the collection.
Properties
Name Type Description
mapModel MapModel The map model that this collection is associated with.
Source:

isLEONetwork() → {boolean}

Checks if this collection of presets is fetched from the LEO Network.
Source:
Returns:
True if there is a URL and it contains the LEO Network domain, false otherwise.
Type
boolean

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

Parse the configured zoom presets or the GeoJSON response from the LEO Network.
Parameters:
Name Type Description
resp Array.<object> | object The configured zoom presets passed to parse may be one of: 1. custom presets directly from a map config: a list of objects with properties like `description`, `latitude`, `longitude`, `height`, `title`, and `image` 2. the configuration for the LEO Network collection: an object with a `url` and optionally `layerIds` property 2. a GeoJSON response from the LEO Network.
options object Options for parsing the response.
Properties
Name Type Attributes Description
mapModel MapModel <optional>
The map model that this collection is associated with, used to get all layers.
Source:
Returns:
A list of ZoomPresetModel instances representing the parsed zoom presets.
Type
Array.<ZoomPresetModel>

parseLEONetwork(response) → {Array.<object>}

Parse the GeoJSON response from the LEO Network to extract zoom preset data.
Parameters:
Name Type Description
response GeoJSON The GeoJSON response from the LEO Network.
Since:
  • 2.35.0
Source:
Returns:
An array of objects representing zoom presets.
Type
Array.<object>