Class: MapSearchFiltersConnector

MapSearchFiltersConnector()

A model that handles connecting the Map model, the SolrResults model, and the Filters model, e.g. for a CatalogSearchView.

Constructor

new MapSearchFiltersConnector()

Since:
  • 2.25.0
Source:

Extends

  • Backbone.Model

Methods

connect()

Set all necessary listeners between the Map, SearchResults, and Filters so that they work together.
Source:

connectFiltersMap()

Connect or re-connect the filters to the map. This will enable the map to start updating any spatial filters in the filters collection with the extent of the map view.
Source:

coordinateMoveEndSearch()

Coordinate behaviour between the two map related sub-connectors when the map extent changes. This is necessary to reduce the number of search queries. We keep the moveEnd behaviour within the sub-connectors so that each sub-connector still functions independently from this coordinating connector.
Source:

defaults()

The default values for this model.
Properties:
Name Type Description
map Map The Map model to use for this connector.
searchResults SolrResults The SolrResults model to use
filters Filters The Filters model to use for this
Source:

disconnect(resetSpatialFilteropt)

Disconnect all listeners between the Map, SearchResults, and Filters.
Parameters:
Name Type Attributes Default Description
resetSpatialFilter boolean <optional>
false If true, the spatial filter will be reset to the default value, which will effectively remove any spatial constraints from the search.
Source:

disconnectFiltersMap(resetSpatialFilteropt)

Disconnect the filters from the map. This stops the map from updating any spatial filters in the filters collection with the extent of the map view.
Parameters:
Name Type Attributes Default Description
resetSpatialFilter boolean <optional>
false If true, the spatial filter will be reset to the default value, which will effectively remove any spatial constraints from the search.
Source:

getConnectors() → {Array.<Backbone.Model>}

Get all the connectors associated with this connector.
Source:
Returns:
An array of connector models.
Type
Array.<Backbone.Model>

getMapConnectors() → {Array.<Backbone.Model>}

Get all the connectors associated with the Map.
Source:
Returns:
An array of connector models.
Type
Array.<Backbone.Model>

initialize(attrs, options)

Initialize the model.
Parameters:
Name Type Description
attrs Object The attributes for this model.
options Object The options for this model.
Properties
Name Type Attributes Default Description
map Map | Object <optional>
The Map model to use for this connector or a JSON object with options to create a new Map model. If not provided, the default from the appModel will be used. See AppModel#catalogSearchMapOptions.
searchResults SolrResults | Object <optional>
The SolrResults model to use for this connector or a JSON object with options to create a new SolrResults model. If not provided, a new SolrResults model will be created.
filterGroups Array.<FilterGroup> | FilterGroup <optional>
An array of FilterGroup models or JSON objects with options to create new FilterGroup models. If a single FilterGroup is passed, it will be wrapped in an array. If not provided, the default from the appModel will be used. See AppModel#defaultFilterGroups.
addGeohashLayer boolean <optional>
true If set to true, a Geohash layer will be added to the Map model if one is not already present. If set to false, no Geohash layer will be added. A geohash layer is required for the Search-Map connector to work.
addSpatialFilter boolean <optional>
true If set to true, a spatial filter will be added to the Filters model if one is not already present. If set to false, no spatial filter will be added. A spatial filter is required for the Filters-Map connector to work.
catalogSearch boolean <optional>
false If set to true, a catalog search phrase in the Filters will be appended to the search query that limits the results to un-obsoleted metadata. See Filters#createCatalogSearchQuery.If set to true, a catalog search phrase will be appended to the search query that limits the results to un-obsoleted metadata.
Source:

isConnected() → {boolean}

Check if all connectors are connected.
Source:
Returns:
True if all connectors are connected, false if any are disconnected.
Type
boolean

removeSpatialFilter()

Remove the spatial filter from the Filters model.
Source:

resetMoveEndSearch()

Undo the coordination of the two map related sub-connectors when the map extent changes. Reset the moveEnd behaviour of the sub-connectors to their defaults.
Source:
See:
  • coordinateMoveEndSearch

setConnectors(addGeohashLayeropt, addSpatialFilteropt)

Set all the connectors required to connect the Map, SearchResults, and Filters. This does not connect them (see connect()).
Parameters:
Name Type Attributes Default Description
addGeohashLayer boolean <optional>
true If set to true, a Geohash layer will be added to the Map model if one is not already present. If set to false, no Geohash layer will be added. A geohash layer is required for the Search-Map connector to work.
addSpatialFilter boolean <optional>
true If set to true, a spatial filter will be added to the Filters model if one is not already present. If set to false, no spatial filter will be added. A spatial filter is required for the Filters-Map connector to work.
Source:

setFilters(filters, catalogSearchopt)

Set the Filters model for this connector.
Parameters:
Name Type Attributes Default Description
filters Array An array of FilterGroup models or JSON objects with options to create new FilterGroup models. If a single FilterGroup is passed, it will be wrapped in an array.
catalogSearch boolean <optional>
true If true, the Filters model will be created with the catalogSearch option set to true.
Source:
See:

setMap(map)

Set the Map model for this connector.
Parameters:
Name Type Description
map Map | Object The Map model to use for this connector or a JSON object with options to create a new Map model.
Source:

setSearchResults(searchResults)

Set the SearchResults model for this connector.
Parameters:
Name Type Description
searchResults SolrResults | Object The SolrResults model to use for this connector or a JSON object with options to create a new SolrResults model.
Source: