Constructor
new ViewfinderCards()
- Since:
- Source:
Extends
Members
model
- Source:
Methods
initialize(_models, optionsopt)
Constructor for the ViewfinderCards 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 cards 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 the configured viewfinder cards or the GeoJSON response from
the LEO Network. Extended from the ZoomPresets parse method
when zoom presets were deprecated in favor of more generalized
viewfinder cards in 2.37.0. Applies default ordinality, labels, and icons and
synthesizes legacy top-level parameters into a map type button action.
Parameters:
| Name |
Type |
Description |
resp |
Array.<object>
|
object
|
The configured cards passed to parse
may be one of:
1. custom cards 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
3. 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 ViewfinderCardModel
instances representing the parsed viewfinder cards.
-
Type
-
Array.<ViewfinderCardModel>
parseLEONetwork(response) → {Array.<object>}
Parse the GeoJSON response from the LEO Network to extract viewfinder
card data. Functionality remains unchanged but this was updated to
return ViewfinderCards instead of the legacy ZoomPresets format when
zoom presets were deprecated in 2.37.0.
Parameters:
| Name |
Type |
Description |
response |
GeoJSON
|
The GeoJSON response from the LEO Network. |
- Since:
- Source:
Returns:
An array of objects representing viewfinder cards.
-
Type
-
Array.<object>